Adding body class for IE

If you have style to add just for some IE versions, you can add a class to the body element (ie6, ie7, ie8). This can be done without any JS, only with conditional statements for IE in the markup.

<!--[if lt IE 7]>      <body>    <![endif]-->
<!--[if IE 7]>         <body>    <![endif]-->
<!--[if IE 8]>         <body class-"ie8 oldie">    <![endif]-->
<!--[if (gte IE 9) | !(IE)]><!-->      <body>  <!--<![endif]-->
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s