Discussion: Float and Shrinkwrap
Afficher un message
Vieux 09/04/2008, 09h24   #34
Ben C
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Float and Shrinkwrap

On 2008-04-07, Gus Richter <gusrichter@netscape.net> wrote:
[...]
> 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.


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.
  Réponse avec citation
 
Page generated in 0,04759 seconds with 9 queries