Skip to content

Instantly share code, notes, and snippets.

@jensgro
Created November 17, 2010 06:23
Show Gist options
  • Save jensgro/703062 to your computer and use it in GitHub Desktop.
Save jensgro/703062 to your computer and use it in GitHub Desktop.
Create a special class for body depending on which IE or if no IE reads the page. Helps for avoiding hacks. Uses conditional comments.
<!--[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]-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment