Skip to content

Instantly share code, notes, and snippets.

@melvinstanly
Created July 26, 2021 10:48
Show Gist options
  • Save melvinstanly/00828c2f6c830656a8b99f2abd1a27d2 to your computer and use it in GitHub Desktop.
Save melvinstanly/00828c2f6c830656a8b99f2abd1a27d2 to your computer and use it in GitHub Desktop.
nth child tricks
//Choose first two and last two childs
p:nth-child(-n + 2) {
color: orange;
}
p:nth-last-child(-n + 2) {
color: orange;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment