Blog Archive
-
▼
2012
(25)
-
▼
August
(14)
- The cascade and specificity
- Attribute selectors
- Child and adjacent sibling selectors
- Advanced selectors
- The universal selector *
- Pseudo-classes
- Common selectors
- Getting Your Styles to Hit the Target
- Divs and spans
- IDs or Classes?
- Naming your elements
- IDs and class names
- The power of meaning
- A brief history of markup
-
▼
August
(14)
Labels
- CSS (25)
- Tutorials (4)
- Web design (7)
Powered by Blogger.
Thursday, August 30, 2012
The universal selector *
The universal selector is possibly one of the most powerful and least used of all the selectors. The universal selector acts like a wild card, matching all the available elements. Like wild cards in other languages, the universal selector is denoted by an asterisk. The universal selector is often used to style every element on a page. For instance, you can remove the default browser padding and margin on every element using the following rule:
* {
padding: 0;
margin: 0;
}
When combined with other selectors, the universal selector can be used to style all the descendants of a particular element or skip a level of descendants. You will see how this can be put to practical effect a little later in this chapter.
Címkék:
CSS
Subscribe to:
Post Comments (Atom)
0 Comments:
Post a Comment