Avoid assigning flex:1
to that column because it will expand to occupy all available space.
Instead, leave the flex value empty and it will default to width:auto
.
.flex {
display: flex;
}
.inside {
border: 1px solid #000;
}
.inside-right {
flex: 1;
background:#c0ffee;
}
<div class="flex">
<div class="inside inside-left">Left</div>
<div class="inside inside-right">RIght</div>
</div>
<div class="flex">
<div class="inside inside-left">Left Left Left LeftLeft Left</div>
<div class="inside inside-right">RIghtRIghtRIght RIght</div>
</div>
<div class="flex">
<div class="inside inside-left">Left Left Left LeftLeft LeftLeft Left Left LeftLeft Left</div>
<div class="inside inside-right">RIghtRIghtRIght RIghtRIghtRIght</div>
</div>
UPDATE: The original goal was to have each "left" element be sized equally.
Flexbox does not offer this capability, but it can be achieved with CSS Tables.
.row {
display: table-row;
}
.inside {
display: table-cell;
border: 1px solid grey;
}
.inside-left {
background: lightgreen;
}
<div class="row">
<div class="inside inside-left">Left</div>
<div class="inside inside-right">RIght</div>
</div>
<div class="row">
<div class="inside inside-left">Left Left Left LeftLeft Left</div>
<div class="inside inside-right">RIghtRIghtRIght RIght</div>
</div>
<div class="row">
<div class="inside inside-left">Left Left Left LeftLeft LeftLeft Left Left LeftLeft Left</div>
<div class="inside inside-right">RIghtRIghtRIght RIghtRIghtRIght</div>
</div>