I have a unique challenge with two divs positioned side by side. The first div contains random text of varying lengths, while the second div holds a random number of inner divs.
My goal is to have these two divs completely fill the space within their wrapper, with the text overflowing from the first div once the second div expands enough. This setup allows me to use a font-sizing plugin like jquery-textfill to adjust the font size as needed to ensure it fits within the first div.
Check out this full example with buttons to refresh the random text and add squares within the wrapper:
Here is the HTML code:
<div id="wrapper">
<div id="left"></div>
<div id="right"></div>
</div>
Here is the associated CSS:
#wrapper{
width: 400px;
height: 50px;
background-color: lightgreen;
}
#left{
float:left;
}
#right{
float:right;
overflow: hidden;
}
.square{
margin-left: 2px;
width: 50px;
height: 50px;
background-color: red;
float:right;
}
Best regards, teamol