Click to See Complete Forum and Search --> : Clear Both


SuzanneB
09-20-2008, 01:19 PM
I seem to constantly have the problem that floating images poke out the bottom of DIV's that are supposed to contain them, and the only way to expand the DIV to cover all of the image is to place an element after the image with a Clear Both defined for that element. That forces the elememt to be placed below the floating image and so expands the containing DIV down to the bottom of the image. Either that, or specify the height of the containing DIV. Neither solution is great.

If you have an image floating in containing DIV, is it possible to ensure that the DIV extends to the bottom of the image by adjusting some property of the DIV, so I don't have to add an element after the image that has a clear both in it?

aj_nsc
09-20-2008, 02:08 PM
overflow: auto (http://www.quirksmode.org/css/clearing.html)