# HG changeset patch # Parent 7d4a4a7220ff5c10ffa66a74bd8d4ff796cb0e45 # User Kang-Hao (Kenny) Lu Remove incorrect formal grammar. Tighten up some normative prose a bit diff --git a/selectors3/Overview.src.html b/selectors3/Overview.src.html --- a/selectors3/Overview.src.html +++ b/selectors3/Overview.src.html @@ -1414,23 +1414,14 @@ For example, this allows the selectors to address every other row in a table, and could be used to alternate the color of paragraph text in a cycle of four. The a and b values must -be integers (positive, negative, or zero). The index of the first child -of an element is 1. - -

In addition to this, :nth-child() can take -'odd' and 'even' as arguments instead. -'odd' has the same signification as 2n+1, -and 'even' has the same signification as 2n. - -

The argument to :nth-child() must match the grammar -below, where INTEGER matches the token [0-9]+ -and the rest of the tokenization is given by the -Lexical scanner in section 10.2: - -

nth
-  : S* [ ['-'|'+']? INTEGER? {N} [ S* ['-'|'+'] S* INTEGER ]? |
-         ['-'|'+']? INTEGER | {O}{D}{D} | {E}{V}{E}{N} ] S*
-  ;
+be integers (i.e. without a decimal dot "."). +The index of the first child of an element is 1. + +

In addition to this, :nth-child() can take a single +IDENT token representing ‘odd’ or +‘even’ instead. ‘odd’ has the same signification +as 2n+1, and ‘even’ has the same signification as +2n.

Examples:

@@ -1446,10 +1437,8 @@ p:nth-child(4n+4) { color: purple; }
-

When the value b is preceded by a negative sign, -the "+" character in the expression must be removed (it is -effectively replaced by the "-" character indicating the negative -value of b).

+

If the b part is present, there must be one and only one sign +("+" or "-") after the an part.

Examples:

@@ -1493,9 +1482,9 @@ tr:nth-child(2n) /* same */
-

Whitespace is permitted after the "(", before the ")", and on either -side of the "+" or "-" that separates the an and -b parts when both are present. +

Whitespaces and comments are permitted after the +"(", before the ")", and on either side of the "+" or "-" that separates the +an and b parts when both are present.

Valid Examples with white space: