I have a flex <div>containing several elements (I do not know the exact number in advance).
<div class="container">
<div class="inner">1</div>
<div class="inner">2</div>
<div class="inner">3</div>
<div class="inner">4</div>
<div class="inner">5</div>
<div class="inner">6</div>
</div>
.container {
display: flex;
flex-wrap: wrap;
}
Let's say I expect 3 to 15 children, and they have a minimum width, but can increase to 2x to fill the remaining space (here is the fiddle: https://jsfiddle.net/r3xch5n9/ ).
With flex-wrap: wrap;I can make them flow in new lines when necessary. Usually the result is nice to see, for example, in this case with 3 and 3 elements

But with different total widths, the result is odd

Is there a way to make the browser split the div?
EG: In the above case, I expect 3 elements in a row, with a white field between them of 5 elements in the first row and only 1 in the second.