Created
July 26, 2021 10:48
-
-
Save melvinstanly/00828c2f6c830656a8b99f2abd1a27d2 to your computer and use it in GitHub Desktop.
nth child tricks
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
//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