Forums

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

Home Forums CSS [Solved] Nth of Type CSS Selection

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #236105
    murrayac
    Participant

    How do I select the following using nth-of-type()?

    big small small big big small small big ...

    #236107
    Paulie_D
    Member

    Not sure what you are trying to achieve.

    If you have a concrete example it might be easier to help.

    Remember though, the nth selectors only select elements not classes… and even then only within the same parent.

    #236110
    Paulie_D
    Member

    However, what I think you are asking, (after thinking about it)…is the pattern….which would be:

    li:nth-of-type(4n),
    li:nth-of-type(4n+1) {
       /* your styles here */
    }
    

    http://codepen.io/Paulie-D/pen/mVEYoa

    #236111
    murrayac
    Participant

    Hey Paulie_D, this is great!! Thanks for the simple soloution.

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