How do I wrap the floating divs of unknown sizes (children) with a border (parent), while keeping the children in the same line.
The problem is that unless the parent div is set to width: 100%;, children tend to collapse one beneath the other.

UPDATE: While posting code, I figured it out, see jsfiddle.
My code had extra <div> wrappers around children. I either had to remove them or set them to display: inline;.
<div class="body">
<div class="parent">
<div>
<div class="child"></div>
</div>
<div>
<div class="child"></div>
</div>
<div>
<div class="child"></div>
</div>
</div>
</div>
Thanks for other great tips!
If you don’t change the children divs to
display: inlineordisplay: inline-block, they will be vertically stacked. If the children arefloated , their size will not push the boundaries of the parent. If you usedisplay: inlineordisplay: inline-block, the children will be inline as long as the parent can be wide enough to fit them all and they will stretch the parent.Fiddle: http://jsfiddle.net/MPCsD/1/