Prev | Current Page 145 | Next

Tommy Olsson and Paul O'Brien

"The Ultimate CSS Reference"

The expression 4n+6 will match the sixth element and every fourth
element after that: the sixth, tenth, fourteenth, and so on. The keyword value odd
is equivalent to the expression 2n+1.
If a and b are equal, or if b is zero, b can be omitted. For example, the expressions
3n+3 and 3n+0 are equivalent to 3n??”they refer to every third element. The keyword
value even is equivalent to the expression 2n.
If a is equal to 1, it can be omitted. So, for example, 1n+3 can be written as n+3. If
a is zero, which indicates a non-repeating pattern, only the element b is required
to indicate the ordinal position of the single element we want to match. For example,
the expression 0n+5 is equivalent to 5, and as we saw above, it??™ll match the fifth
element.
97 Selector Reference
Both a and b can be negative, but elements will only be matched if N has a positive
value. If b is negative, replace the + sign with a - sign.
If your head??™s spinning by now, you??™re not alone, but hopefully Table 4.


Pages:
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157