Skip to content

Instantly share code, notes, and snippets.

@sivakumar-kailasam
Last active October 4, 2015 06:27
Show Gist options
  • Save sivakumar-kailasam/2592968 to your computer and use it in GitHub Desktop.
Save sivakumar-kailasam/2592968 to your computer and use it in GitHub Desktop.
IE specific css
<!--[if lt IE 7 ]> <html class="ie ie6"> <![endif]-->
<!--[if IE 7 ]> <html class="ie ie7"> <![endif]-->
<!--[if IE 8 ]> <html class="ie ie8"> <![endif]-->
<!--[if IE 9 ]> <html class="ie ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html> <!--<![endif]-->
<head>
<style>
/* this is for all browsers*/
div.foo {
color: red;
}
/* this is for all ie versions of ie */
.ie div.foo {
color: yellow;
}
/* this is applied only to ie6 */
.ie6 div.foo {
color: green;
}
</style>
</head>
<body></body>
</html>
<!--
note: the conditional comments should be on top of the page where you'd write your html tag.
You can read in detail about this from http://paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment