CSS3 Pseudo-classes
CSS3 provides many more pseudo-classes than CSS2. Though browser support for them is varied, it is improving.
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:checkedPseudo-class
matches elements like checkboxes or radio buttons that are checked:not(S)
matches elements that aren’t matched by the specified selector
User-contributed notes
- ID:
- #1
- Date:
- Sat, 28 Feb 2009 23:31:29 GMT
- Status:
- This note has not yet been confirmed for accuracy and relevance.
The address for this page says "css3psuedoclasses" instead of "css3pseudoclasses".
Add a note
To post a note on this topic, please log in with your SitePoint username and password. If you don't have an account yet, you can create a new account for free.