View Full Version : What is "* html #content" for in CSS?

Nov 16th, 2006, 05:10 AM
I was messing around with a CSS layout for another thread and saw a template. Viewing the source shows the CSS in the main html page.


What I don't understand is why it has both of these:

#content { ... }
* html #content { ... }

Wouldn't they map to the same thing?


Nov 16th, 2006, 05:38 AM
No they wouldn't.

* html #content
will target IE6 and below. It does not effect IE7 or any other standards compliant browser mainly because html should be the first element but IE6 and below thinks there is some 'star' element before the html element.

The suggested method of targetting different IE browsers is to use conditional comments (http://www.quirksmode.org/css/condcom.html).

Nov 16th, 2006, 05:39 AM
Ahh, ok thank a lot. I suspected it was for some compatibility reason but couldn't figure out what.