I have a parent div with a variable number of child divs with the same size placed on the left. I want the parent div to expand to the width of the children, no matter what, even if it means overflowing its container.
Is there a way to do this naturally with HTML / CSS?
Example (a stretch div will have a width of 180 pixels):
HTML:
<div id="stretchable-div"> <div class="child"></div> <div class="child"></div> <div class="child"></div> ... </div
CSS
.child { width: 60px; height: 60px; float:left; }
html css layout
Yarin
source share