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…
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.
:nth-child(n) counts every sibling, of S counts only those matching S
.featured:nth-child(odd) It means "an element at an odd place that is also .featured", not "the 1st, 3rd… featured". For the second, write :nth-child(odd of .featured).hidden or display: none row is still a sibling and still counted by :nth-child(even). Use :nth-child(even of :not([hidden])) (or another selector that filters the hidden rows).:nth-of-type when you meant to filter by class :nth-of-type counts per tag name (li, tr), not per class. .featured:nth-of-type(2) still counts every li. To count per class or attribute, use of S.-n+3 or 3n+1 The n under each cloth shows which n reaches it..featured:nth-child(odd) with :nth-child(odd of .featured) Different cloths, because they count from different bases.hidden cloth is still counted by :nth-child..featured:nth-of-type(odd) It gives what the naive way gives: every cloth is an li, so of-type counts every li.