What does * in a CSS mean?

fuzzybabybunny

Moderator<br>Digital & Video Cameras
Moderator
Jan 2, 2006
10,455
35
91
So I've got this in my CSS and I have no idea what it means.

* {
margin:0px;
padding:0px;
}

 

stevf

Senior member
Jan 26, 2005
290
0
0
* is the universal selector so it is setting the margin & padding to 0px for all elements on the page.

As an aside, I have found I get the best results comparing my pages between different browsers by selecting a strict doctype, setting the margins to 0 for all elements that dont have some other margin set, and then validating the HTML and CSS.
 

911paramedic

Diamond Member
Jan 7, 2002
9,448
1
76
It resets ALL padding and margins to zero. UL's, P's, H1, H2, H3, etc.

It can come in handy, but you now need to space those items. Try googling "css reset".
 

FeuerFrei

Diamond Member
Mar 30, 2005
9,144
929
126
It means none of the asterisks on the page will have a margin or padding.




;)