Skip to content

CSS Selectors

Position nth-child(n of <selector>)

About

The :nth-child() pseudo-class supports an of <selector> syntax. It finds the elements matching the specified selector and then matches the elements based in their position in that filtered set of elements.

Paragraphs only

The selector :nth-child(3n + 1 of p) finds all paragraphs (of p) and then matches the first and every third paragraph.