I receive an unknown number of items that I display in a flexbox, with a maximum of 3 per row. As long as there are 3 items on a row, this code centers it but if there are less than 3, it will keep them as if there were 3, but with a gap where the other items would be. For example, if there are 11 items, it will render four rows with a gap in the 'third spot' on the fourth row. I want the two items on the final row to be centered.
This is what I currently have:
.Container {
display: flex;
flex-wrap: wrap;
align-items: center;
}
.item {
flex-basis: 33%;
display: flex;
justify-content: center;
}
Am I missing something obvious, or is this not possible with flexbox?