CSS3 - More Pseudo Classes
The big advantage to all the pseudo classes that CSS3 is adding is that it allows you to do away with many of the HTML tags that are only there to provide hooks for attaching CSS into your page. It also does away with the need to add classes or ids to some elements.
In addition to the structural and state pseudo classes, CSS3 also adds several more.
- :empty might qualify as a structural pseudo class depending on just how you define structural. It matches an element that does not have any child elements or text nodes within it at all.
- :root only matches when the element is the root element of the document. It is mainly for use with XML since in HTML the <html> element is always the root and so only html:root will ever match.
- :not() is the negation pseudo class. It will match anything that doesn't match the condition specified within the parentheses.
The latest versions of all browsers will recognise these selectors. Earlier versions may not.
This article written by Stephen Chapman, Felgall Pty Ltd.