Posted By

Nettuts on 08/13/10


Tagged


Versions (?)

Who likes this?

12 people have marked this snippet as a favorite

maltem
seanpowell
wdeer
barbietunnie
f1r3fl3x
kukhtenko
suzt808
1983ron
qubestream
SevenLayersDesign
leobetosouza
adambundy


Target All Internet Explorers with the Body Class Trick


 / Published in: HTML
 

URL: paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/

Nifty!

  1. <!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
  2. <!--[if lt IE 7 ]> <body class="ie6"> <![endif]-->
  3. <!--[if IE 7 ]> <body class="ie7"> <![endif]-->
  4. <!--[if IE 8 ]> <body class="ie8"> <![endif]-->
  5. <!--[if IE 9 ]> <body class="ie9"> <![endif]-->
  6. <!--[if gt IE 9]> <body> <![endif]-->
  7. <!--[if !IE]><!--> <body> <!--<![endif]-->

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: Nettuts on August 13, 2010

Via Paul Irish.

Posted By: SevenLayersDesign on March 4, 2011

The latest version applies the class to the HTML tag now. Thanks for the snippet!

You need to login to post a comment.