Skip to content

Instantly share code, notes, and snippets.

@rdebeasi
Created July 2, 2013 19:56
Show Gist options
  • Save rdebeasi/5912570 to your computer and use it in GitHub Desktop.
Save rdebeasi/5912570 to your computer and use it in GitHub Desktop.
Counting with nth-child
:nth-child(4n+1) {} /* - For 1, 5, 9, 13...*/
:nth-child(4n-2) {} /* For 2, 6, 10, 14... */
:nth-child(4n-1) {} /* For 3, 7, 11, 15... */
:nth-child(4n) {} /* For 4, 8, 12, 16... */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment