W3C home > Mailing lists > Public > www-style@w3.org > October 2008

Re: Float Model

From: Ingo Chao <i4chao@googlemail.com>
Date: Mon, 6 Oct 2008 12:19:30 +0200
Message-ID: <879e9bc50810060319x714dacf7oa1886a8d1ec7486f@mail.gmail.com>
To: "Keiji Ikari" <kei@teamikaria.com>
Cc: "Ph. Wittenbergh" <jk7r-obt@asahi-net.or.jp>, "W3C Style List" <www-style@w3.org>

2008/10/6 Keiji Ikari <kei@teamikaria.com>:
Keiji Ikari wrote:
> On reading CSS 9.4.1... So, this says a block should not wrap (displace) around a float, only
> its content should.

No, the paragraph you've cited is about boxes *in* a block formatting
context. CSS 2.1: 9.5 handles how a box that establishes a block
formatting context is displaced by a float.

> So that's not similar to the IE haslayout float model at all.

haslayout establishes something similar to a new BFC, but a
haslayout-block and a BFC are not equal. The properties
width|height|zoom|writing-mode trigger haslayout, but should not a
establish a BFC according to CSS2.1. On the other hand, some
properties should establish a BFC, but are not supported in IE6
(display:table-*, position:fixed) or do not work without haslayout
already set (overflow:hidden|scroll|auto).

> I need a way to wrap blocks around floats without a) setting them to float as well or b) giving them a margin to get out
> the way of the float, since both of these completely defeat the
> purpose.

(in another mail, you wrote:)

> Usually I agree with the standards over what IE chooses to do,
> however, in this case, there is nothing desirable about the standards
> float model, while the IE float model makes a lot more sense.

No, the IE float model is very unhandy when I want boxes to overlap
floats or when I want floats to escape out of their containers. You
can't do that when haslayout is set on these boxes, but you are
required to trigger haslayout for stability reasons.

> Perhaps a new style attribute could be added to block elements to
> define which float model to use.

I agree that a property that just establishes a new Block Formatting
Context, without the side-effects of theses properties
(display:inline-block|table-*, position:auto|fixed,
overflow:hidden|auto|scroll, float:left|right), would be helpful.

Ingo

-- 
Ingo Chao
http://www.satzansatz.de/
Received on Monday, 6 October 2008 10:20:05 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:55:15 GMT