Skip to content

Instantly share code, notes, and snippets.

@ericponto
Created May 13, 2013 03:02

Revisions

  1. ericponto created this gist May 13, 2013.
    11 changes: 11 additions & 0 deletions nth-child-ranges
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    /* the 3rd one */
    li:nth-child(3) {}

    /* the 3rd and up */
    li:nth-child(n+3) {}

    /* up to the 3rd */
    li:nth-child(-n+3) {}

    /* the 3rd up to the 7th */
    li:nth-child(n+3):nth-child(-n+7) {}