I trying to figure out if this is possible.
Supposing I've a layout like this:
.flex-container {
align-content: space-between;
align-items: flex-start;
display: flex;
flex-flow: row wrap;
justify-content: space-between;
}
.flex-item {
background: tomato;
width: 31%;
height: 150px;
line-height: 150px;
color: white;
font-weight: bold;
font-size: 3em;
text-align: center;
}
<div class="flex-container">
<div class="flex-item">1</div>
<div class="flex-item">2</div>
<div class="flex-item">3</div>
<div class="flex-item">4</div>
<div class="flex-item">5</div>
</div>
.flex-container height must be auto, because items are loaded dynamically
- How can I accomplish that space-between flex-item in the cross-axis be the same that main-axis (if width of flex-item is 31%, 31x3 = 93% so space-between would be 3.5%).
- Change the last flex-item alignment to be like flex-start to avoid the white space between.