"inkswamp" <inkswamp (AT) gmail (DOT) com> wrote:
Quote:
I've been using CSS for quite a while now but I have yet to master its
eccentricities. Here's something I recently ran across and if someone
could explain why this happens, I would appreciate it.
I've included code below. The code produces three divs, each with
height set to "auto." Within each div is an image. If I float the image
left or right, the height of the box does not accommodate the height of
the image automatically. If I don't apply a float to the image, the
height of box stretches out to accommodate the image height.
Why? |
Floating an element takes it out of the flow, hence it is not included
when the height if its parent is calculated.
Steve
--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor
Steve Pugh <steve (AT) pugh (DOT) net> <http://steve.pugh.net/>