homepage Welcome to WebmasterWorld Guest from 54.242.140.11
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

    
using the * universal selector
*, body
nyteshade



 
Msg#: 4382063 posted 1:43 pm on Nov 1, 2011 (gmt 0)

I recently discovered some CSS that will fill the viewport with the current document at boagworld. It's this:
*, body {
margin: 0; padding: 0;
}

#container {
display: block;
position: absolute;
min-height: 100%;
}

#content {
display: block;
margin-bottom: 3em;
}

#footer {
position: absolute;
display: block;
bottom: 0;
height: 3em
}


I understand everything here execpt the " *, body "? I mean, if you use * then it selects all elements including body right? Then why include body, it's not a descendant as used here, right? Also, wouldn't html* accomplish the same thing?
I've got a decent handle on CSS but the symbols leave me scratching my head sometimes. Thx all.

 

topr8

WebmasterWorld Senior Member topr8 us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4382063 posted 2:00 pm on Nov 1, 2011 (gmt 0)

* means everything,

the body in the first line of code is superfluous

nyteshade



 
Msg#: 4382063 posted 2:14 pm on Nov 1, 2011 (gmt 0)

I thought as much, but I needed to do a brain-check, thanks!

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