homepage Welcome to WebmasterWorld Guest from 54.211.219.20
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: not2easy

CSS Forum

    
What is meant * {} in CSS?
spongenika



 
Msg#: 4401636 posted 10:29 am on Dec 27, 2011 (gmt 0)

What is meant


*
{...}


in CSS file.

 

penders

WebmasterWorld Senior Member penders us a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



 
Msg#: 4401636 posted 11:36 am on Dec 27, 2011 (gmt 0)

The
* is the universal selector; it matches any element. So your example will apply the style rule to every element.
spongenika



 
Msg#: 4401636 posted 11:40 am on Dec 27, 2011 (gmt 0)

Thanks.

lucy24

WebmasterWorld Senior Member lucy24 us a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



 
Msg#: 4401636 posted 10:02 pm on Dec 27, 2011 (gmt 0)

OK, now I'm curious. Are there any circumstances where you would legitimately do this? As opposed to, say,
html {blahblah}
and letting everyone else inherit from there. Are we talking size, color, what?

alt131

WebmasterWorld Senior Member 5+ Year Member



 
Msg#: 4401636 posted 10:38 pm on Dec 27, 2011 (gmt 0)

he he, one of those questions where the answer begs the question ;).

Not all properties inherit by default Appendix F. Full property table [w3.org], and not all versions would apply inherit even if explicitly set. Hence the popularity of variations of:
* {
margin:0;
border:0;
}

But as the universal selector is very inefficient I think the real message in the question really is to ask if it is the best way to achieve the desired outcome. Legimate? I guess that depends on the code-complexity/code inefficiency trade-off

edit reason
Clarify

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved