Using Conditional Comments to Serve Different Styles to IE6 and IE7
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 (3)
excellency said:
thank you for its article
# June 12, 2008 2:12 PM
Bill said:
Just finished my new site using Joomla 1.5 and IE6.0. Site displays fine in IE but... In Firefox3.05 front page background color is dark blue while subsiquent pages are fine???
# January 22, 2009 6:23 AM
mike said:
Bill you should look foward and stop developing and designing for IE6. Aim your energies to follow the web standards instead of M$'s weird-way to do stuff.
You will learn much more that way.
# February 4, 2009 2:21 PM