When needing to serve styles to certain versions of Internet Explorer, use conditional comments. Multiple conditional comments can be used.
This following code shows possible usage, with a demo page as well:
<style type="text/css">
p {font:bold 12px/17px arial;}
p.colordependency {background:cyan;}
</style>
<!--[if IE]>
<style type="text/css">
p.hidefromIE {display:none;}
</style>
<![endif]-->
<!--[if IE 6]>
<style type="text/css">
p.hidefromIE6 {display:none;}
</style>
<![endif]-->
<!--[if lte IE 6]>
<style type="text/css">
p.colordependency {background:red;}
</style>
<![endif]-->
<!--[if IE 7]>
<style type="text/css">
p.hidefromIE7 {display:none;}
p.colordependency {background:yellow;}
</style>
<![endif]-->
Comments (1)
excellency said:
thank you for its article
# June 12, 2008 2:12 PM