Re: Overflow and Margins

On Feb 2, 2008, at 2:24 PM, Bruno Fassino wrote:

>
> Brad Kemper wrote:
>> Isn't it a bit odd that of one block is wider than its parent, and
>> the parent is set to "overflow:scroll", that the margins of
>> the child are shown on the top, bottom, and left, but not on the
>> right? Is that the way it is supposed to be?
>
> I guess this is because the "over-constrained" case of 10.3.3 [1]  
> applies to
> the child, so (when direction is ltr) the specified value of  
> 'margin-right'
> is ignored, and to satisfy the equality its used value must become a
> negative value, but this has no effect on the rendering.

Interesting. Maybe the definition of "containing block'" should be  
changed then. It seems to me that once scrollbars are produced, there  
are two boxes instead of one: the box that contains the parent's  
border, margin, and scrollbars, and the box inside that which  
contains  the parent's padding and contents. This inner box grows as  
large as it needs to in order to contain its contents, and is  
revealed when scrolling. So, shouldn't this inner box be the new  
containing block, and shouldn't it also grow to contain the right  
margin, just as it grew to contain the other margins and the content?

I would propose that something change to allow that to happen. It  
seems like it would have a rather mild effect on existing designs,  
while making the effect of margins more predictable.

>
> [1] http://www.w3.org/TR/CSS21/visudet.html#blockwidth
>
> --
> Bruno Fassino http://www.brunildo.org/test
>
>

Received on Saturday, 2 February 2008 23:08:26 UTC