Home  »  CodeSnippets   »   Selecting not Last Child in CSS

Selecting not Last Child in CSS

Posted: February 7, 2022 | by Michael Bright

:not(:last-child)

Select last li in a ul:

li:not(:last-child) { 
 margin-bottom: 20px
} 

Found this article interesting? Follow Brightwhiz on Facebook, Twitter, and YouTube to read and watch more content we post.