Created
September 24, 2012 14:47
-
-
Save mikefowler/3776316 to your computer and use it in GitHub Desktop.
Handy nth-child Recipes
This file contains 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
// Odd or Even | |
&:nth-child(even/odd) { } | |
// Every third item | |
&:nth-child(3n) {} | |
// Every third item, starting with the first | |
&:nth-child(3n-5) { } | |
// Every fourth item | |
&:nth-child(4n) { } | |
// Every fourth item, starting with the first | |
&nth-child(4n-7) { } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment