Ben C wrote:
Quote:
On 2008-04-08, Gus Richter <gusrichter@netscape.netwrote:
Quote:
>dorayme wrote:
Quote:
>>I am inclined to actually use the phrase "containing block" where the
>>context shows it to do a job of containing.
>>>
>>Because the point is that it is the container, the parent, the big house
>>where the children live... It is crucial that it is on the container,
>>the parent, that rel pos is made for the abs to work.
>>>
>>And I find it interesting how the "layers" work and yet the float still
>>exerts the influence to push aside (displace) the text or pics in the
>>following divs. Just had never thought of the float rules operating from
>>a smothered "underneath" position! Those float rules are powerful voodoo
>>huh? <g>
>1. Any floated item will be out of the normal flow.
>2. When floated left, it will position itself to top,left (0,0) of its
>"container block".
>3. The special feature of a float is that any inline box content in the
>"container box" will shift over to make room for the float.
>4. Blah, blah, blah, blah.
>>
>You are having difficulty in accepting the container thing, so try
>asking yourself:
> "If the float positions itself to 0,0 of the container block,
> then what could be the container block?"
>
Sometimes 0,0 of more than one container blocks occupy the same pixel on
the screen, so this is not a good criterion.
>
body
float
div
>
In this example, 0,0 of div and body are in the same place because of
margin collapsing.
>
So which is the containing block for the float? Body, not the div,
because it's the block level ancestor as specified.
I agree.
My explanation of 0,0 of the container block fits simplistically.
The following condenses the spec a little more in detail:
1. Any floated item will be out of the normal flow.
2. A float will position itself to the _top_ of any "block", "float" or
"line box" earlier in the source (further rules are provided in the case
of collapsing margins).
3. When floated left, it will position itself to the _left_ of its
"containing block" and when floated right, it will position itself to
the _right_ of its "containing block" (further rules are provided in the
case of collapsing margins).
[A "Containing Block" is a generated box for the content/descendants
and the containing block's behavior is determined by the "type" of box
generated.]
4. The special feature of a float is that any inline box content in the
"container box" will shift over to make room for the float.
Caveat: Although I "got it" when I wrote it, I find on re-reading that I
have to reference the spec (bad part: in several different chapters) to
see what I was talking about. So it needs quite a few more re-reads for me.
--
Gus