On 2008-04-07, Gus Richter <gusrichter@net scape.netwrote:
[...]
No the containing block for a float is always above it in the document
tree.
But floats "invade" subsequent blocks in the same block formatting
context. So if you do this:
body
float
div
the text in the div flows around the float. But the float's containing
block is still body.
This kind of situation is further complicated by the fact that the div's
top margin collapses with that of body regardless of the float.
body
div
float
therefore often looks the same, although here the float's containing
block is the div, not body.
[...]
In my examples, "wrapper" and "containing block" are two different things.
The "wrapper" is simply used to reposition the segment pairs. In your
examples in the link I mention above, you use headings to accomplish
this w/o wrappers.
The "containing block" is each one of the yellow boxes in every one of
your examples on the page linked above (yellow boxes in my examples as
well). It is a bit counter-intuitive in that normally a container comes
first in the markup, but in the case with floats, the "container block"
comes _after_ the float.
The "wrapper" is simply used to reposition the segment pairs. In your
examples in the link I mention above, you use headings to accomplish
this w/o wrappers.
The "containing block" is each one of the yellow boxes in every one of
your examples on the page linked above (yellow boxes in my examples as
well). It is a bit counter-intuitive in that normally a container comes
first in the markup, but in the case with floats, the "container block"
comes _after_ the float.
tree.
But floats "invade" subsequent blocks in the same block formatting
context. So if you do this:
body
float
div
the text in the div flows around the float. But the float's containing
block is still body.
This kind of situation is further complicated by the fact that the div's
top margin collapses with that of body regardless of the float.
body
div
float
therefore often looks the same, although here the float's containing
block is the div, not body.
Comment