Published on

CSS nth-of Selector

Authors

CSS nth-of Selector

What's new in CSS and UI - IO 2023 Edition

It's another way to use nth-child, it makes available to filter only childs with a certain query to be selected:

.highlight:nth-child(2) would select the second children without filtering anything .highlight:nth-child(2 of .special) will filter only the children with .special class and take the second of them

PS: Has good support from browsers