This snippet demonstrates the problem:
.flex-cont{
display: flex;
justify-content: space-between;
flex-wrap: wrap;
}
.child {
flex-basis: 30%;
height: 70px;
margin-bottom: 25px;
border: 1px solid black;
background-color: blue;
}
<div class="flex-cont">
<div class="child one"></div>
<div class="child one"></div>
<div class="child one"></div>
<div class="child one"></div>
<div class="child one"></div>
</div>
I want the available space to spread in between the child elements. But when there is a row with less elements than columns, I want them to display one after the other, without an empty spot. Any ideas on how to solve this using CSS?