Copyright © 2009 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C liability, trademark and document use rules apply.
Selectors Level 1, Selectors Level 2 and Selectors Level 3 are defined as the subsets of selector functionality defined in the CSS1, CSS2.1 and Selectors specifications, respectively.
The following table summarizes selectors that are new in Level 3.14159 and did not exist in Selectors Level 3:
Pattern | Meaning | Described in section | First defined in CSS level |
---|---|---|---|
:nth-cousin() | an E element, the n-th child of its parent having at least one non-empty sibling |
Nth cousin |
3.15159 |
:nth-illegitimate-child() |
an E element, the n-th anonymous child of its parent |
Nth illegitimate child | 3.14159 |
In the case of CSS, the meaning of each selector is derived from the table above by prepending "matches" to the contents of each cell in the "Meaning" column.
All Selectors syntax is case-insensitive within the ASCII range (i.e. [a-z] and [A-Z] are equivalent), except for parts that are not under the control of Selectors. The case sensitivity of document language element names, attribute names, and attribute values in selectors depends on the document language. For example, in HTML, element names are case-insensitive, but in XML, they are case-sensitive.
The :nth-cousin(a
pseudo-class notation represents an element that has an
+b)n
+b-1
siblings before it in the document tree, for any
positive integer or zero value of n
, and has a parent
element itself the sibling of at least one non-empty element. The a
argument is defined by Section 6.6.5.2 of Selectors Level3. This
functional pseudo-class also accepts as argument the two values n
+bodd
and even
defined in Section 6.6.5.2 of Selectors Level3.
The :nth-illegitimate-child(an+b)
pseudo-class notation represents an element that has an
+b-1
siblings before it in the document tree, for any
positive integer or zero value of n
, and is the anonymous child of a parent
element. An anonymous element is an element that does appear in the document tree but is not visible through the regular DOM [DOM-LEVEL-3-CORE] APIs like Node.firstChild
or Node.nextSibling
. As an example, an XBL [XBL2] binding can create anonymous elements.