Forums

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

Home Forums CSS Select all items after 10th item

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #31941
    emma
    Participant

    Hiya,

    I’ve got an ordered list and would like to select all list items after the 10th one. Is there a way to do this with pure css with some kind of nth child selector or somethin similar?

    Cheers,

    emma

    #56070
    TheDoc
    Moderator

    You would do this for your nth child selector:

    :nth-child(1n+11)

    #56071
    noahgelman
    Participant

    The 1 is a little redundant. This works too.
    :nth-child(n+11)

    #56054
    emma
    Participant

    Perfect, thanks both! :)

    #113904
    bbnnt
    Participant

    ok guys… what if I want have a specific css every 3 elements (to do a :nth-child(3n+3)) but only after the eleventh element ?

    #113905
    JohnMotylJr
    Participant

    @bbnnt

    Something like this? It works but im not too sure its semantic, i bet there is a better way.

    li:nth-child(n+11):nth-child(3n+3) { }

    CodePen example:

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