Web features explorer

:nth-child()

Widely available
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. To learn more, see :nth-child(), :nth-last-child() at MDN.

Compatibility