Skip to content

Instantly share code, notes, and snippets.

@AllThingsSmitty
Created July 23, 2015 14:45
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AllThingsSmitty/1d35a73b8c03dd945a2f to your computer and use it in GitHub Desktop.
Save AllThingsSmitty/1d35a73b8c03dd945a2f to your computer and use it in GitHub Desktop.
Use negative nth-child to select items 1 through n
li {
display: none;
}
/* select items 1 through 3 and show them */
li:nth-child(-n+3) {
display: block;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment