/ Published in: HTML
URL: http://paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/
This snippet is a Paul Irish original, and allows you to target IE browsers specifically without having to add in an extra http request with another separate stylesheet. Basically, depending on the IE browser that the user is using, a class is added to the body tag. If the user is not using IE, then a classless body tag is used. This allows you to target specific browsers in your css without having to use css hacks, or further stylesheets.
Expand |
Embed | Plain Text
<!--[if lt IE 7 ]> <body class="ie6"> <![endif]--> <!--[if IE 7 ]> <body class="ie7"> <![endif]--> <!--[if IE 8 ]> <body class="ie8"> <![endif]--> <!--[if IE 9 ]> <body class="ie9"> <![endif<]--> <!--[if (gt IE 9)|!(IE)]><!--> <!--<![endif]-->
You need to login to post a comment.
