Last active
June 16, 2019 08:21
-
-
Save quelicm/2569776 to your computer and use it in GitHub Desktop.
play a bit with nth-child and nth-last-child #css #selectors #nth-child
This file contains hidden or 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
/** | |
* play a bit with nth-child and nth-last-child | |
*/ | |
div { | |
width: 40px; | |
height: 40px; | |
margin: 2px; | |
border: solid 2px #444 | |
} | |
div:nth-child(n+4):nth-last-child(n+4) { | |
background: #ccc; | |
} | |
div:nth-child(2n+3):nth-last-child(2n+3) { | |
border-color: #f0a; | |
} |
This file contains hidden or 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
<!-- content to be placed inside <body>…</body> --> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
This file contains hidden or 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
{"view":"split-vertical","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment