Last active
August 25, 2017 06:05
-
-
Save luiseduardobraschi/cb9ff81a7c627b62e0db18248d30393d to your computer and use it in GitHub Desktop.
One-liner last-child style remover.
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
<style> | |
ul { | |
list-style:none; | |
} | |
li { | |
display: inline-block; | |
padding: 5px; | |
} | |
</style> | |
<ul> | |
<li>lorem</li> | |
<li>ipsum</li> | |
<li>this is the last item</li> | |
</ul> |
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
li { | |
border-right:2px solid #b4da55; | |
} | |
li:last-child { | |
border-right:none; | |
} |
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
/* | |
Add the style to every item which is not the last one. | |
*/ | |
li:not(:last-child) { | |
border-right:2px solid #b4da55; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment