Created
July 23, 2015 14:45
-
-
Save AllThingsSmitty/1d35a73b8c03dd945a2f to your computer and use it in GitHub Desktop.
Use negative nth-child to select items 1 through n
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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