Prev | Current Page 139 | Next

Tommy Olsson and Paul O'Brien

"The Ultimate CSS Reference"


SPEC
CSS3
BROWSER SUPPORT
Op9.2 Saf3 FF2 IE7
NONE NONE NONE NONE
91 Selector Reference
The following example selectors are equivalent, and will match odd-numbered table
rows:
tr:nth-child(2n+1) {
?‹® declarations
}
tr:nth-child(odd) {
?‹® declarations
}
This example selector will match the first three rows of any table:
tr:nth-child(-n+3) {
?‹® declarations
}
This example selector will match any paragraph that??™s the first child element of its
parent element:
p:nth-child(1) {
?‹® declarations
}
This is, of course, equivalent to the selector p:first-child (p. 88).
Compatibility
Selector Reference
Opera Safari Firefox Internet Explorer
9.2 3.0 2.0 1.3 2.0 1.5 1.0 7.0 6.0 5.5
None None None None None None None None None None
This pseudo-class is currently supported only by the Konqueror web browser.8
8 http://www.konqueror.org/
The Ultimate CSS Reference 92
:nth-last-child(N)
:nth-last-child( { number expression | odd | even } )
{
declaration block
}
This pseudo-class matches elements on
the basis of their positions within a
parent element??™s list of child elements.


Pages:
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151