W3C home > Mailing lists > Public > www-style@w3.org > November 2002

Re: floats (block or inline context)

From: Bert Bos <bert@w3.org>
Date: Tue, 12 Nov 2002 18:59:22 +0100
To: "Sigurd Lerstad" <sigler@bredband.no>, <www-style@w3.org>
Message-Id: <200211121859.22624.bert@w3.org>

On Saturday 26 October 2002 18:04, Sigurd Lerstad wrote:
> Hello,
>
> en element that is a float is forced to have display:block,
>
> and block boxes participate in a block formatting context, and inline
> elements in an inline formatting context..
>
> But are elements that are floats an exception to this rule, in a
> block formatting context there's no notion of current line for
> example, so a float box should rather be part of an inline formatting
> context with special handling of floats?

The block-like behaviour of floats refers to certain aspects of floats: 
they have margins, they behave as containing blocks for their children, 
they are rectangular, etc. But they also differ from normal blocks, 
e.g., their top margin doesn't collapse and (as you remarked) they are 
placed relative to some inline elements in their parent's flow.

So yes, floats are special. We just say that they are blocks, because in 
many respects they behave like blocks and thus we only have to define 
the exceptions. And it is useful to have a definite value for the 
'display' property when you query it via the DOM.

>
> (I realize that this is very implementation dependant, and that
> implementations can do whatever they want as long as the results are
> the same, just asking for some pointers :)


Bert
-- 
  Bert Bos                                ( W 3 C ) http://www.w3.org/
  http://www.w3.org/people/bos/                              W3C/INRIA
  bert@w3.org                             2004 Rt des Lucioles / BP 93
  +33 (0)4 92 38 76 92            06902 Sophia Antipolis Cedex, France
Received on Wednesday, 13 November 2002 10:32:28 GMT

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