Tumblr css example

SO https://stackoverflow.com/questions/70583839/is-there-a-way-to-dinamically-add-a-last-class-to-the-last-post-appearing-in-a

by Luke Harby

HTML

<div id="posts">
    <div class="post">
        Post 1
    </div>
    <div class="post">
        Post 2
    </div>
    <div class="post">
        Post 3
    </div>
</div>

CSS

#posts .post {
    margin-bottom: 20px;
    border-bottom: 2px solid #444;
}
#posts .post:last-of-type {
    background-color: orange;
    border-bottom: none;
}