what "*" means in css class

I have copied an css file from an existing web page.

In the style sheet i have found this code

* {
    margin: 0;
    padding: 0;

I have no idea what this is for, could any one explain this to me.
Who is Participating?
WizardOfOgzConnect With a Mentor Commented:
This is NOT an example of star hack or an IE-specific rule.

* is the universal CSS selector which matches an element of any type.  See http://www.w3.org/TR/CSS2/selector.html#universal-selector

The rule you posted will be apply a 0 margin and padding to all elements.
Pratima PharandeCommented:
This is the "star property hack" along the same lines as the "underscore hack." It includes junk before the property that IE ignores (the * works up to IE 7, the _ up to IE 6).


Kiran SonawaneProject LeadCommented:
If you want to apply only to IE then use * preceded. In short it is just IE specific rule.
If you are curious about the star hack that was mentioned and similar CSS hacks for IE you can read about them here
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.