Prev | Current Page 101 | Next

Tommy Olsson and Paul O'Brien

"The Ultimate CSS Reference"

In this reference, we??™ll use the CSS2
terminology, which should be familiar to most readers.
Universal Selector
* {
declaration block
}
The universal selector matches any
element type. It can be implied (and
therefore omitted) if it isn??™t the only
component of the simple selector. The
two selector examples shown here are
equivalent:
*.warning {
?‹® declarations
}
.warning {
?‹® declarations
}
SPEC
CSS2
BROWSER SUPPORT
Op9.2+ Saf1.3+ FF1+ IE5.5+
FULL FULL FULL BUGGY
Example
This rule set will be applied to every
element in a document:
* {
margin: 0;
padding: 0;
}
1 http://www.w3.org/TR/css3-selectors/#changesFromCSS2
61 Selector Reference
It??™s important not to confuse the universal selector with a wildcard character??”the
universal selector doesn??™t match ???zero or more elements.??? Consider the following
HTML fragment:


The Universal Selector


We must emphasize the following: