By now, you may have discovered that conditional comments are processed in the HTML output, rather than within the CSS file itself, unless you opt for third-party software.
Another technique for targeting IE in your CSS files without resorting to hacks involves:
<!--[if lt IE 7]> <html class="ie6"> <![endif]-->
<!--[if IE 7]> <html class="ie7"> <![endif]-->
<!--[if IE 8]> <html class="ie8"> <![endif]-->
<!--[if gt IE 8]><!--> <html> <!--<![endif]-->
This method has gained popularity for targeting IE, possibly popularized by HTML5 Boilerplate. It involves using conditional comments to add a class to the <html>
tag (or body tag if preferred) to allow specific styling in your CSS like this:
.ie6 #header {
/* styles for IE6 only here */
}
I find this approach more manageable than utilizing separate stylesheets, although it does result in other browsers reading (but not implementing) the IE-specific styles.