Paul_o_b - 10:20 pm on Jul 19, 2012 (gmt 0)
Eeuw. Wouldn't that give you a scroll bar? What happens if you set a min-height on the container?
min-height is of no real use because content may be variable height.:)
Overflow (other than visible) creates a new "block formatting context" and will then automatically contain child floats. You will not get a scrollbar unless the content inside is too big. In most cases you can use overflow:hidden to better effect or use the revised clearfix method (google it).
As a matter of interest overflow isn't the only property that will automatically contain floats it is any property that creates a new block formatting context. Which are as follows (taken directly from the specs):
"Floats, absolutely positioned elements, block containers (such as inline-blocks, table-cells, and table-captions) that are not block boxes, and block boxes with 'overflow' other than 'visible' (except when that value has been propagated to the viewport) establish new block formatting contexts for their contents."
Overflow (other than visible)is the most useful for containing floats but only when you don't need visible overflow. If you need visible overflow then use the clearfix method or indeed float the parent if the design allows.
Note that IE7 and under just need haslayout to contain child floats so they need an extra rule suh as the proprietary zoom:1.0 or perhaps more validly a dimension where possible.