Prev | Current Page 65 | Next

Tommy Olsson and Paul O'Brien

"The Ultimate CSS Reference"

63), which will match HTML class attributes
containing the word ???warning.???
As such, the selector above would match the first line of text within any p element
that has a class attribute value of "warning" and is an adjacent sibling to an h2
element.
Finally, two or more selectors can be grouped, separated by commas (,); the
declaration block that follows applies to both selectors. Consider these two rules:
#main ol {
margin-left: 2em;
}
#main ul {
margin-left: 2em;
}
They can be grouped like this:
#main ol, #main ul {
margin-left: 2em;
}
You can read about selectors in detail in the selector reference section (p. 59).
General Syntax and
Nomenclature
The Ultimate CSS Reference 28
Declaration Blocks
Declaration blocks begin with a left curly brace, {, and end with a right curly brace,
}. They contain zero or more declarations (p. 28) separated by semicolons:
h2 {
color: #666;
}
A declaration block is always preceded by a selector (p. 26). We can combine
multiple rules that have the same selector into a single rule.


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