Prev | Current Page 63 | Next

Tommy Olsson and Paul O'Brien

"The Ultimate CSS Reference"

51) at-rule:
@media print {
body {
font-size: 12pt;
}
}
Here??™s an example of an at-rule terminated by a semicolon??”the @import (p. 49)
at-rule:
General Syntax and
Nomenclature
The Ultimate CSS Reference 26
@import url(base.css);
Rule Sets
A rule set (also called a rule) comprises a selector (p. 26) followed by a declaration
block (p. 28); the rule set applies the declarations listed in the declaration block to
all elements matched by the selector.
Here??™s an example of a rule set:
h2 {
color: #666;
font-weight: bold;
}
Selectors
A selector comprises every part of a rule set (p. 26) up to??”but not including??”the
left curly brace {. A selector is a pattern, and the declarations (p. 28) within the
block that follows the selector are applied to all the elements that match this pattern.
In the following example rule set, the selector is h2:
h2 {
color: #666;
font-weight: bold;
}
This selector??”which is comprised of a single simple selector??”will match all
elements of type h2 in an HTML document.


Pages:
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75