How should i do this grid on flex? If i give justify-content: space-between
to the parent, the bottom line will have big space between(big space between mean, right and left and empty space at center, if i'll remove justify-content: space-between
and do it with margin-right
i will have margin-right at all right block, at all rows.
.list {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
border: 2px solid red;
}
.item {
width: 23%;
height: 150px;
margin-bottom: 10px;
background: blue;
}
<div class="list">
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
</div>