: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()
:nth-child()
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;
}
Explore other pages
- meter
A scalar measurement within a known range, or a fractional value.
- scroll-snap-type
Specifies whether a scroll container is a scroll snap container, how strictly it snaps, and which axes are considered.
- :nth-child()
Represents an element that has an+b-1 siblings before it in the document tree.
- :nth-last-child()
Represents an element that has an+b-1 siblings after it in the document tree.