What does this code actually do

Hi,
I was wondering what does this code snippet do.

* html .wrapper {
	width:48em;
}

It didn’t seem doing anything. When I remove it, nothing happens.

I take this from a tutorial site. Should I keep it or remove it.
Thanks,

Its a hack (* html) for IE6 and under and no longer needed unless you support IE6.

The universal (*) selector represents any element in that position and as there is no parent to the ‘html’ element the rule should fail silently. However IE6 believes that html does have a parent and basically treats the rule as ‘html . wrapper’.

Its called the ‘star selector hack’ if you want to google it :slight_smile:

3 Likes

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.