The selector
|
Functional description
|
E:firse-child
|
Element E that is the first child of the parent element. And E: the NTH – child (1)
|
E:last-child
|
Element E as the last child of the parent element. Equivalent to E: nth-last-child(1)
|
E:root
|
Select the trailing element of the document that matches element E. In HTML documents, the trailing element is always HTML, and the selector matches the same content as the HTML type selector.
|
E F:nth-child(n)
|
Select the NTH child F of the parent E. N can be an integer (1, 2, 3), keyword (even, odd), formula (2n+1, -n+5), and the N value starts with 1
|
E F:nth-last-child(n)
|
Select the NTH child f of element E. This selector is evaluated in the opposite order to the E F: nth-Child (n) selector, but is used in the same way :nth-last-child(1) always matches the last element, which is the same as :last-child
|
E:nth-of-type(n)
|
Selects the NTH E element within the parent element that has the specified type
|
E:nth-last-of-typy(N)
|
Selects the penultimate E element of the specified type within the parent element
|
E:first-of-type
|
Selects the first E element within the parent element with the specified type, equivalent to :nth-of-type(1)
|
E:last-of-type
|
Selects the last E element within the parent element with the specified type, equivalent to E:nth-last-of-type(1)
|
E:only-child
|
Select that the parent element contains only one child element and that child element matches the E element
|
E:only-of-type
|
Select a parent element that contains only one child element of the same type that matches the E element
|
E:empty
|
Select an element that has no child elements and does not contain any text nodes.
|