Emanuele D'Arrigo wrote:
<div id="div1">
    <div id="div2">
        <div id="div3" width="45px" style="display:inline">Meoow</div>
        <div id="div4" width="50%" style="display:inline">Wooof</div>
    </div>
</div>

I'm going to assume you meant to not put in the "display:inline" part, and meant style="width: 45px" and such...

div1 asks to div2 how wide it wants to be. div2 in turn ask to div3 and div4 
how wide they
want to be. If both div3 and div4 used absolute measurements such as
px or mm the measurements would simply bubble back up to div1 who
would then proceed to set the size and position for div2 who in turn
would set the sizes and positions of div3 and div4.

"It depends". In the CSS box model, div1 knows how wide it will be. It gives that information to div2, which then decides how wide it will be. It gives that information to div3 and div4, which then decide how wide they will be, then how tall, and pass that information to div2. It decides how tall it will be, then passes that information to div1 and layout is done when div1 decides how tall it is. See http://www.w3.org/TR/CSS21/visudet.html for more details (including all the complicated cases, etc).

In the XUL flexbox model, behavior is significantly more complicated, of course, since both widths and heights are output...

-Boris
_______________________________________________
dev-tech-layout mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-layout

Reply via email to