Answer the question
In order to leave comments, you need to log in
How to make margin-bottom on all inline-blocks that are "not on the last line"?
Inline blocks are automatically wrapped to a new line.
It's good when one inline block occupies the entire line and you can put :not(:last-child).
But what if there are a lot of inline blocks, and we do not know in advance how many of them will move to the last line?
That is, the line size is of course limited. That is, for example, they will fit 3 pieces per line. But the last line can contain either 1 or 2 or 3 elements.
And you need to make sure that the last line does not have margin-bottom: 10px, and all the rest do.
How to do it smart?
Answer the question
In order to leave comments, you need to log in
Take a look at CSS Quantitative Selectors
.
For your particular question, you have already been given a good and simple solution, but the article describes solutions for many similar and more complicated situations.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question