.containerdiv{
white-space: nowrap;
}
.childdiv{
display : inline-block;
}
<div class="containerdiv">
<div id="child1" class="childdiv"></div>
<div id="child2" class="childdiv></div>
</div>
I have set the CSS above to prevent the child divs from wrapping. However, I am facing an issue where "child2" is exceeding the width of its parent container due to varying widths specified in "child1". How can I make sure that "child2" does not exceed the maximum width of the parent container without calculating and manually setting the value? Your assistance is greatly appreciated. Thank you.