:nth-child (CSS3)

The :nth-child pseudo-class matches an element that has an+b-1 siblings before it in the document tree, for a given positive or zero value for n, and has a parent element.

Syntax

:nth-child( { number expression | odd | even } ) { declaration block }

Examples having uses of: ':nth-child'

1 votes
12k views

CSS nth-child

The nth child selector is used to select the specified element of the page.
0 votes
1k views

CSS odd pseudo

This selects elements based on a simple provided algebraic expression (e.g. "2n" or "4n-1"). Has the ability to do things like select even/odd elements, "every third", "the first five", and things like that. CSS :odd is the same as :nth-child(odd) or :nth-child(2n+1)
0 votes
1k views

CSS even pseudo

This selects elements based on a simple provided algebraic expression (e.g. "2n" or "4n-1"). Has the ability to do things like select even/odd elements, "every third", "the first five", and things like that. CSS :even is the same as :nth-child(even) or :nth-child(2n)