Apply IE conditional classes to html tag (instead of body) #44

imdario opened this Issue Aug 11, 2010 · 5 comments


None yet

4 participants

imdario commented Aug 11, 2010

This is not really an issue but based on would be nice to change the IE conditional classes to html tag.

As said, that will not block the download and save some bytes from the empty conditional comment at

Thanks for your time!


The downside is that it'll get much bigger...


<!--[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)]><!--> <body> <!--<![endif]-->


<!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
<!--[if IE 7 ]>    <html lang="en" class="no-js ie7"> <![endif]-->
<!--[if IE 8 ]>    <html lang="en" class="no-js ie8"> <![endif]-->
<!--[if IE 9 ]>    <html lang="en" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"> <!--<![endif]-->

thoughts anyone?


I would prefer the IE classes on html because CMSes like Drupal/WP almost always have a bodyclasses function on the body opening tag. It makes it less of a hassle to edit for various custom CMSes.


Also, imagine a scenario where you have ids and classes on body like:

<body id="cart" class="shopping ie6">

You cannot really get this to work in ie6:

.shopping.ie6 p { padding-left: 2px }

Putting it on html tag gives the liberty to do something like:

.ie6 .shopping p { padding-left: 2px }

Good usecases, adeel and divya. I think we can make this change.


IE conditional classes moved to html tag. Closed by 35ababe

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment