A Guide to CSS3 Pseudo-classes

A walk through the other new CSS3 pseudo-classes

The pseudo-classes are used to target elements without having to add extra classes, attributes or ID; that is why it is called in that way, pseudo-class. Throughout our previous posts, we have covered a few new CSS3 pseudo-classes, including :not, :before and :after, :first-of-type and we also use pseudo-classes in some of our tutorials. And in this post we are going to walk through the other new CSS3 pseudo-classes that have not been covered yet. Let’s take a look.

:nth-child

:nth-child is used to target elements in a particular order of their parent. This pseudo-class is used in conjunction with the following parameters: a number (1, 2, 3, etc), a keyword (odd / even) or an equation (an, an+b, an-b, etc). In the following example, we have three paragraphs inside a <div>.

Lubov Cholakova

Lubov CholakovaLubov has been with DMXzone for 8 years now, contributing to the Content and Sales departments. She is bringing high quality content in the form of daily blog updates, reviews, tutorials, news, newsletters,update emails and extensions' manuals. If you have a product that needs publicity or any other questions about the entire DMXzone community, she is the one you can contact.

See All Postings From Lubov Cholakova >>

Comments

Be the first to write a comment

You must me logged in to write a comment.