Код: Выделить всё
First
Second thing is long
Third is
Fourth is even longer and longer
Fifth
Sixth
Код: Выделить всё
.container {
width: 800px;
display: flex;
background: blue;
overflow: auto; //it's okay if the items overflow and scroll
flex-wrap: nowrap;
height: 130px;
}
.item {
margin: 10px;
background: red; // the color here is to make it easier to see if all the items are the same width
flex-shrink: 0;
display: flex;
flex-wrap: nowrap;
flex-basis: calc(100% / 6); //the number 6 here will be dynamic, but it will always be the number of items in the container
}
Подробнее здесь: https://stackoverflow.com/questions/790 ... xt-with-no