W3C home > Mailing lists > Public > www-style@w3.org > January 2009

Re: [CSS2.1-9.5] [CSS2.1-9.4.1] Block formatting context and Floats

From: Anton Prowse <prowse@moonhenge.net>
Date: Thu, 22 Jan 2009 20:16:51 +0100
Message-ID: <4978C623.6070300@moonhenge.net>
To: www-style@w3.org

Tab Atkins Jr. wrote:
> On Wed, Jan 21, 2009 at 3:40 PM, Anton Prowse <prowse@moonhenge.net> wrote:
>> Tab Atkins Jr. wrote:
>>> I happened to discover the issue outlined above
>>> during a recent site design, where the ability to force the block
>>> width to shrink so that its left edge moves away from a left float was
>>> very useful.
>> Would you be prepared to point us the example for this? I would love to know
>> how people are finding this behaviour useful.[2]
> Certainly.  http://igofigure.com/page/store-igo-figure-software/ is
> the page that I was working on at the time.

Thanks for showing us!  (For those without the time to inspect the page 
in much detail, the area of the page in question is the middle-right 
area with a white background, possessing a left-floated product 
promotion block followed by an overflow:hidden container holding the H1 
and an button-like hyperlink.)

The floated block has no width specified, relying instead on 
shrink-to-fit behaviour.  Hence, the width of the subsequent block 
cannot be known, and indeed a non-floated BFC is required here if that 
block is to be a "closed unit" with respect to descendant clears.

However, this example doesn't shed any light on the particular aspect of 
the "BFCs next to floats" discussion that I wished to highlight, since 
neither the float nor the non-floated BFC have side margin specified. 
Hence the only sensible placement of the BFC, given that it will be 
narrowed to sit alongside the float, is with its left border edge 
incident with the float's right border edge.  (I realise, on re-reading 
your comment, that you were pointing out the usefulness of the "narrow 
to sit alongside" behaviour in general, not of the specific behaviour of 
the margin area boxes!  Hence my request for an example was unnecessary; 

The issue I'm specifically raising is what happens when either the float 
has a right margin or the BFC has a left margin (or both).  Should the 
margins abut, or should the BFC's left margin appear to "slide 
underneath" the float's margin area box?

To put it another way, if authors specify a positive left margin on the 
BFC, either this margin is unnecessary because it slides under the 
float's margin area box anyway, or it adds extra separation in addition 
to what the float's right margin provides (and which could just as 
easily be achieved by increasing the float's right margin, which by 
cross-browser consensus is "solid").

What examples exist in the wild where the difference matters?  Do they 
really prevent us from picking one or the other and thus explicitly 
defining this behaviour?  After all, any breakage would appear to be 
trivial to fix by adjusting the float's right margin.

Anton Prowse
Received on Thursday, 22 January 2009 19:17:40 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:38:23 UTC