Web features explorer

:nth-child()

Widely available since 2018-01-29
Tags: css Groups: CSS > Selectors

The :nth-child() and :nth-last-child() CSS functional pseudo-classes match elements based on their index within a list of elements. The :first-child and :last-child pseudo-classes match the first and last element in a list, and the :only-child pseudo-class matches an element with no siblings.

Learning resources on MDN

Browser support