Brian Cray ··· Home > Blog > Css > Target IE6 and IE7 with only 1 extra character in your CSS

Target IE6 and IE7 with only 1 extra character in your CSS

IE6 and IE7 are the bastards of the web design world. We all know it. IE6 more so.

To get around the inadequacies and bugs of IE6 and IE7, I see people going to great lengths and even adding a second stylesheet with conditional comments when we all preach at the same time to minimize HTTP requests.

Complicated hacks and workarounds all take more time. And time is money in the business world (especially to support a dying user base).

#myelement
{
color: #999; /* shows in all browsers */
*color: #999; /* notice the * before the property - shows in IE7 and below */
_color: #999; /* notice the _ before the property - shows in IE6 and below */
}

And there you have it. That's all you have to do. Stop wasting your time, your client's money, your users' bandwidths, and your otherwise zen disposition.

By the way, if you want to argue with me about perfectly validating CSS, provide a business case for validating CSS. No idealistic bullshit.

For more on IE6, check my newest article: The IE6 support equation: Is it worth supporting?