JSFiddle - React, Tailwind, and code Playground
HTML
<div id="parent">
<div id="fixedSize">
XYZ
</div>
<div id="mainSize">
DAYUM
</div>
</div>
CSS
#parent {
padding: 5px;
background-color: rgba(255, 0, 0, 0.5);
width: 500px;
/* This solved the problem:*/
overflow: auto;
}
#fixedSize {
background-color: rgba(0, 0, 255, 0.5);
width: 150px;
float: left;
}
#mainSize {
background-color: rgba(0, 255, 0, 0.5);
float: right;
width: 350px;
}