JSFiddle - React, Tailwind, and code Playground
HTML
<div class="parent" style="display:inline-block;">
<div class="flex">
<div class="flex-child">One</div>
<div class="flex-child">Two</div>
<div class="flex-child">Three (really really long)</div>
<div class="flex-child">Four</div>
</div>
</div>
<br>
<div class="parent" style="float:left;">
<div class="flex">
<div class="flex-child">One</div>
<div class="flex-child">Two</div>
<div class="flex-child">Three (really really long)</div>
<div class="flex-child">Four</div>
</div>
</div>
CSS
.parent {
padding: 10px;
background: red;
}
.flex {
display: flex;
}
.flex-child {
flex: 1 0 100px;
/*width: 100px; replace the flex-basis by with to solve the issue */
background: #EEE;
border: 1px solid black;
white-space: nowrap;
overflow: hidden;
}