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.

Examples

td:empty {background-color:#ccc;}
p:not(:first-child) {font-style:normal;}

Limitations

The latest versions of all browsers will recognise these selectors. Earlier versions may not.

 

This article written by Stephen Chapman, Felgall Pty Ltd.

go to top

FaceBook Follow
Twitter Follow
Donate