Answer the question
In order to leave comments, you need to log in
Is it possible to determine the elements from the last row in flexbox or count the number of elements in css?
Hello, help me, I'm making a mixin to create grids from a given number of columns and indent between them.
An example can be looked at - https://jsfiddle.net/yof4trp0/
But here's the problem - you need to remove the margin-bottom from the elements in the last line, otherwise it turns out ugly
Question: is it possible to somehow calculate the number of current elements inside the container? To do something like this:
&:nth-last-of-type(-n + abs($elemCount / $count)) {
margin-bottom: 0;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question