Archived topic
How to make something like :not(:last-child) but for the blog last post
3 replies · Started by Dimitrios on November 8, 2021
Basically, I want to add a 5px padding-bottom to my blog articles except for the last article.
.blog .inside-article {
padding-bottom: 5px;
}
How to make the CSS work in the blog articles except the last one. Because I want to keep the space as it is between the last article and the footer.
CHECK THIS IMAGE TO UNDERSTAND WHAT I WANNA DO: https://ibb.co/Mk5qNDx
By the way, I don't wanna change the padding-top because it will mess with something else. So is it possible to make padding-bottom work for every article in the blog page except the last one? I tried .blog .inside-article:not(:last-child) but it didn't work.
-Jim
Hi Jim,
try this one:
.blog article.post:not(:last-child) .inside-article {
padding-bottom: 5px;
}
It worked! Thank you so much!
No problem. :D