Conditional Classnames

Paul Hammond has a very clever idea about avoiding conditional sytlesheets for Internet Explorer. Basically, if we just use conditional comments for IE to include a classname in the body tag, we can isolate the specific IE rules in the main stylesheet.


  • Avoids any extra HTTP requests for files with IE-only hacks
  • Slicker than including that monstrosity inside the head tag
  • Allows for easier reading and maintenance of stylesheets. The IE hacks can be placed where they’re relevant in the stylesheet.


  • Doesn’t this defeat the entire idea of separating out hacks from standard CSS?

Does anyone else have opinions on the matter?

You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

Comments are closed.