CSS hacks or Conditional stylesheets?
Ugly and Uglier
There is no perfect way to handle IE. Each method has its own advantages and disadvantages. But what is the best way? In my opinion, it varies from project to project but one thing is guaranteed, you WILL have to deal with IE. The purpose of this post is to pass on what I have learned about CSS hacks.
Evil CSS HACK
Ugly? Oh! it gets uglier
margin-top: -8px; /* for all the real browsers */
margin-top/*\**/: 8px\9; /* hack for IE8 */
*margin-top: 8px; /* hack for IE7 */
OK, how about conditional stylesheets?
Looks better than hacks but additional HTTP requests to download. Imagine supporting ie6, ie7, ie8, ie9 and so on. Every time there is a new version, we would have to create another conditional style sheet to support it. In the case above, there will be 4 additional HTTP request.
Paul Irish suggested a solution and the answer is not to use any one of the methods above. I personally like this method but there is no right or wrong way.
In conclusion, you are still going to have multiple CSS rules, even if they are on the same stylesheet.
Thanks for sharing Paul Irish