Forums

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

Home Forums CSS help with nth child

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #32648
    cybershot
    Participant

    I added a span with a class to add an image after the navigation link. It works fine but now I need to remove the first one and leave the rest. I thought nth-child ? Does this work for the first one though?

    #77096
    jamygolden
    Member

    Wouldn’t :first-child be more efficient?

    #76962
    cybershot
    Participant

    i am targetting the first element. Not a child. would that work?

    #76965
    chrisburton
    Participant

    Can you show the code? Are you referring to something like:

    span.blah:nth-child(1) {display: none;}
    #76974
    jamygolden
    Member
    element:first-of-type { style properties }

    https://developer.mozilla.org/en/CSS/:first-of-type

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