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

Home Forums CSS nth-child question

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
  • #38111

    Shouldn’t this select the 3rd span because it’s the second of the set with .class? It doesn’t, it selects the 2nd span, even though that span is clearly the first of that set, but 2nd of the elements in div.

    Is this default behavior? Because that sucks.

    EDIT: Wow, I instantly solved this, nvm.
    Use nth-of-type(), not nth-child()

Viewing 1 post (of 1 total)
  • The forum ‘CSS’ is closed to new topics and replies.