Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Getting nth-of-type to work for non-siblings? Reply To: Getting nth-of-type to work for non-siblings?

#286003
Paulie_D
Member

nth- selectors require the elements to be siblings…..and only select elements…so you can’t select nth-of-class for instance.

Anything more elaborate than that requires JS

https://stackoverflow.com/questions/5545649/can-i-combine-nth-child-or-nth-of-type-with-an-arbitrary-selector