CSS3

:nth-of-type [p:nth-of-type(2n+1){color: red;}]

Finds all n elements of a certain type. [C2, F3.5, S3, IE9, O9.5, iOS]

Referenced in Tip 10, Styling Tables with Pseudoclasses

:first-child [p:first-child{color:blue;}]

Finds the first child element. [C2, F3.5, S3, IE9, O9.5, iOS3, A2]

Referenced in Tip 10, Styling Tables with Pseudoclasses

:nth-child [p:nth-child(2n+1){color: red;}]

Finds a specific child element counting forward. [C2, F3.5, S3, IE9, O9.5, iOS3, A2]

Referenced in Tip 10, Styling Tables with Pseudoclasses

:last-child [p:last-child{color:blue;}]

Finds the last child element. [C2, F3.5, S3, IE9, O9.5, iOS3, A2]

Referenced in Tip 10, Styling Tables with Pseudoclasses

:nth-last-child [p:nth-last-child(2){color: ...

Get HTML5 and CSS3, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.