In article <fh********************************@4ax.com>, Steve Pugh writes:
Gnolen <he***********@hotmail.com> wrote:
<div id="ads">
<div id="ads_left">content</div>
<div id="ads_right">content</div>
</div>
#ads {width: 510px; height: auto;}
#ads_left { float: left; width: 240px;}
#ads_right { float: right; width: 240px;}
Floated elements are taken out of the doument flow and hence do not
contribute to the height of their parent. Hence 'ads' has no content
and thus no height. You need an element after 'ads_right' and before
the end of 'ads' with clear: both; set.
Why is it that way, anyhow? I'm not disputing that it is -- I know it
is from painful experience. But, it seems to me that this violates
the block-structured paradigm. The floats were declared within the
"ads" block -- why does their scope extend outside of it?
Was there some good reason for the behavior to be defined this way, or
was it just an unintended consequence of some other decision?
The nasty side-effect of this is, of course, that in situations like
this one does need to add a content-free element to end the floating,
which goes and ties presentation back into the HTML.
--
Michael F. Stemper
#include <Standard_Disclaimer>
This sentence no verb.