JSFiddle - React, Tailwind, and code Playground
HTML
<div class="container">
<div class="box">With <code>flex: 1</code> applied to both flex items, the available container space is evenly distributed among both. Each box takes 50% of the container. It doesn't matter how much content there is. The items will overflow vertically if necessary.</div>
<div class="box">box 2</div>
</div>
<br>
<div class="container">
<div class="box">With <code>flex: 1</code> applied to both flex items, the available container space is evenly distributed among both. Each box takes 50% of the container. It doesn't matter how much content there is. The items will overflow vertically if necessary.</div>
<div class="box">box 2</div>
<div class="box">box 3</div>
</div>
<br>
<div class="container">
<div class="box">With <code>flex: 1</code> applied to both flex items, the available container space is evenly distributed among both. Each box takes 50% of the container. It doesn't matter how much content there is. The items will overflow vertically if necessary.</div>
<div class="box">box 2</div>
<div class="box">box 3</div>
<div class="box">box 4</div>
</div>
CSS
.container {
display: flex;
border: 1px solid #ccc;
}
.box {
flex: 1;
background-color: lightgreen;
border: 1px dashed black;
}