Skip to content

Instantly share code, notes, and snippets.

@chmanie
Created September 8, 2014 09:00
Show Gist options
  • Select an option

  • Save chmanie/a24ee561fed415a0fd87 to your computer and use it in GitHub Desktop.

Select an option

Save chmanie/a24ee561fed415a0fd87 to your computer and use it in GitHub Desktop.
CSS rules for the last child and the next-to-last child but only when total child number is even
.my-class:last-child {
// stuff
}
.my-class:nth-last-child(2):nth-child(odd) {
// same stuff as above
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment