So I've designed a component using flex-box properties. This is how it is structured
.units {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: space-between;
overflow-y: scroll;
height: auto;
}
.unit {
height: 5.55rem;
width: 5.8rem;
background: #28a74520;
border-radius: 5px;
padding: 0.5rem;
margin-bottom: 0.75rem;
}
My understanding is that since units
has the property of justify-content
to be space-between
, it maintains it throughout, however, during the circumstances of lesser number of child unit
divs in the last row, the spacing between gets awkward and exaggerated. I would rather have the last row to be flex-start
or something with no space, how do I achieve this?