The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › CSS › Why can't I select tag?
Hi! I’m trying to select a tag using nth-of-type pseudo-selector, but I’m unable to make it work. Can you help me please?
https://codepen.io/rodolfoespinosa/pen/MRgdPx
Try this:
li:nth-of-type(4) a { color: black; }
That li only has a single child…
li
Thanks! It worked.