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: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Thu, 22 Jan 2009 13:44:12 -0600
Message-ID: <dd0fbad0901221144q69056795p52d8ff570466d6b4@mail.gmail.com>
To: Anton Prowse <prowse@moonhenge.net>
Cc: www-style@w3.org

On Thu, Jan 22, 2009 at 1:16 PM, Anton Prowse <prowse@moonhenge.net> wrote:
> (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; sorry!)
> 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.

Heh, sorry.  I did understand the specific issue you were referring to
in your original email, but since you asked...  ^_^

Purely from a makes-sense-to-me point of view, I'm in favor of
specifying that *margins* must not overlap, given that ordinary floats
already behave in this way.  This also provides for some mental
simplifications elsewhere: currently there is little-to-no difference
in using padding or margin on a list to keep the list-item markers
from overlapping surrounding content, but if there are cases where
there *is* a difference (such as if the list has a background on it
that you do *not* want the markers to overlap), having the margin and
padding act uniformly (as they do when not in the presence of a nearby
float) would be preferable.

A somewhat constructed example where it would also matter is in the
case of multiple floats next to an unfloated BFC with a border or
background (thus, margin is required to achieve separation between the
blocks).  WLOG, assume that the floats have identical left and right
margins.  If we *only* prevent borders from overlapping, then we are
stuck with the float-BFC separation being half that of the float-float
separation because the float-float separation does *not* have
collapsing margins, so the separation is equal to right+left margin,
while the float-BFC separation 'ignores' the BFC margin.  To fix this,
we'd have to give the last float a special margin, which is often
slightly more difficult than modifying the BFC margin.

Received on Thursday, 22 January 2009 19:44:47 UTC

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