Skip to content

Instantly share code, notes, and snippets.

@ericponto
Created May 13, 2013 03:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ericponto/5565921 to your computer and use it in GitHub Desktop.
Save ericponto/5565921 to your computer and use it in GitHub Desktop.
Simple uses of :nth-child to select ranges.
/* 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) {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment