Created
May 13, 2013 03:02
-
-
Save ericponto/5565921 to your computer and use it in GitHub Desktop.
Simple uses of :nth-child to select ranges.
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
/* 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