A Pen by Robin Rendle on CodePen.
Created
March 17, 2021 22:18
-
-
Save dimayakovlev/b90126e73a1850ba36b95ead29308199 to your computer and use it in GitHub Desktop.
:not(:last-of-type) example
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
<div class="card"> | |
<ul> | |
<li>Item 1</li> | |
<li>Item 2</li> | |
<li>Item 3</li> | |
<li>Item 4</li> | |
<li>Item 5</li> | |
</ul> | |
</div> |
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
html, | |
body { | |
height: 100%; | |
} | |
body { | |
display: grid; | |
place-items: center; | |
} | |
.card { | |
border: 1px solid #eee; | |
box-shadow: 1px 1px 4px hsla(0, 0, 0, 0.4); | |
border-radius: 3px; | |
min-width: 600px; | |
padding: 20px; | |
} | |
ul { | |
margin: 0; | |
padding-left: 0; | |
list-style: none; | |
} | |
ul li { | |
background-color: hsla(0, 0, 0, 0.3); | |
color: white; | |
padding: 4px; | |
} | |
ul li:not(:last-of-type) { | |
margin-bottom: 20px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment