Welcome to WebmasterWorld Guest from

Forum Moderators: not2easy

Message Too Old, No Replies

using the * universal selector

*, body

1:43 pm on Nov 1, 2011 (gmt 0)

5+ Year Member

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.
2:00 pm on Nov 1, 2011 (gmt 0)

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

* means everything,

the body in the first line of code is superfluous
2:14 pm on Nov 1, 2011 (gmt 0)

5+ Year Member

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

Featured Threads

Hot Threads This Week

Hot Threads This Month