CSS :nth-child(of S) Playground

Eight cloths on Mrs. Lastri’s drying line, hand-drawn and stamped: your selector dyes the cloths the browser really hits, and each cloth shows its place among…

Why it matters

Stripes after a filter, "the 3rd item of this category", the even visible rows: all of them count among some siblings, not all. Without of S this used to need JS or hand-written classes.

The key idea

:nth-child(n) counts every sibling, of S counts only those matching S

Common mistakes

Try it in this playground