CSS3 provides many more pseudo-classes than CSS2.
In this Section
- :nth-child(N)
matches elements on the basis of their positions within a parent element’s list of child elements - :nth-last-child(N)
matches elements on the basis of their positions within a parent element’s list of child elements - :nth-of-type(N)
matches elements on the basis of their positions within a parent element’s list of child elements of the same type - :nth-last-of-type(N)
matches elements on the basis of their positions within a parent element’s list of child elements of the same type - Understanding :nth-child Pseudo-class Expressions
- :last-child
matches an element that’s the last child element of its parent element - :first-of-type
matches the first child element of the specified element type - :last-of-type
matches the last child element of the specified element type - :only-child
matches an element if it’s the only child element of its parent - :only-of-type
matches an element that’s the only child element of its type - :root
matches the element that’s the root element of the document - :empty
matches elements that have no children - :target
matches an element that’s the target of a fragment identifier in the document’s URI - :enabled
matches user interface elements that are enabled - :disabled
matches user interface elements that are disabled - :checked Pseudo-class
matches elements like checkboxes or radio buttons that are checked - :not(S)
matches elements that aren’t matched by the specified selector
No Reader comments