Black Lives Matter! ✊🏾

:nth-child()

The :nth-child(an+b) pseudo-class notation represents an element that has an+b-1 siblings before it in the document tree, for any positive integer or zero value of n. 6.6.5.2. :nth-child() pseudo-class

Links about :nth-child()

  1. :nth Tester

    by CSS Tricks

  2. Mastering the :nth-child | CSS3 pseudo classes and :nth-child ranges

    by James Menera

  3. :nth-child()

    posted on by MDN

    The :nth-child() CSS pseudo-class matches elements based on their position in a group of siblings.

Code sample

li:nth-child(2n) {
border: 5px solid fuchsia;
}