Skip to content

Instantly share code, notes, and snippets.

@mikefowler
Created September 24, 2012 14:47
Show Gist options
  • Save mikefowler/3776316 to your computer and use it in GitHub Desktop.
Save mikefowler/3776316 to your computer and use it in GitHub Desktop.
Handy nth-child Recipes
// 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