lime icon

Phosphorus and Lime

A Developer's Broadsheet

This blog has been deprecated. Please visit my new blog at klenwell.com/press.
CSS: the holy grail of IE css selective selector bugs
UPDATE

For the best part of last year proeminent webdev figures have adviced people to stop using the * html hack. The better alternative is to make use of the conditional comments supported by all versions of Explorer and conditionally include an extra .css file (or several) on top of the others, that only IE will see.


slashdot comment. but I really hate those IE conditional comment things... Oh well, my bad...


Original Post
Just discovered this, though I'm sure it's been around for ages:

* html #test-span
{
color:green;
}


That is, if you want to specify a rule that applies only to IE browsers, use this. And if you want to apply a rule that will not apply to IE browsers, use this:

html>body #test-span
{
color:green;
}


Not sure if this validates or no.

Details here:

http://centricle.com/ref/css/filters/tests/star_html/

keywords: internet, explorer, IE, hack, hacks