I am trying to use flex to create flexible elements of the same width, but they change the width depending on the number of children in the flex-item
fiddle
As you can see, the right green container is much smaller, although both have flexible growth: 1
How can i fix this? Thank!
span {
display: inline-block;
width: 10px;
height: 30px;
border: 1px solid red;
}
.container {
display: flex;
display: -webkit-flex;
border: 1px solid blue;
width: 200px;
padding: 2px;
}
.item {
flex-grow: 1;
-webkit-flex-grow: 1;
border: 1px solid green;
}
source
share