Skip to content

Instantly share code, notes, and snippets.

@dimayakovlev
Created March 17, 2021 22:18
Show Gist options
  • Save dimayakovlev/b90126e73a1850ba36b95ead29308199 to your computer and use it in GitHub Desktop.
Save dimayakovlev/b90126e73a1850ba36b95ead29308199 to your computer and use it in GitHub Desktop.
:not(:last-of-type) example
<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>
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