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

[CSS2.1] 10.3.5 Floating, non-replaced elements

From: Alan Gresley <alan@css-class.com>
Date: Wed, 18 Jun 2008 12:57:32 +1000
Message-ID: <4858799C.9090708@css-class.com>
To: www-style@w3.org

I see in the spec, 10.3.5 Floating, non-replaced elements.


  # Roughly: calculate the preferred width by formatting the
  # content without breaking lines other than where explicit
  # line breaks occur, and also calculate the preferred minimum
  # width, e.g., by trying all possible line breaks. CSS 2.1
  # does not define the exact algorithm.

In this test case.


There is a differences in line breaks between various implementations if 
a line box appears before a float in the source (Example 1). This is the 
typical markup and CSS.

<div style="float: left;">Float left
        <div style="float: left; width: 120px;">Float Left</div>

Gecko 1.9 and Safari 3: The nested float clears the line box *Float 
left* but leaves a space beside the float which equals the width of the 
line box.

Opera 9.50 and IE8b1 (to memory) will not force a line break and the 
line box *Float left* will appear beside the nested float.

This is a very common construction (using shrink-to-fit for outer float) 
but having this undefined behavior with line breaks makes this 
construction impractical for authors to use.

I would please welcome feedback concerning IE8b1 behavior or any part of 
the specs that would explain what should happen.

Received on Wednesday, 18 June 2008 02:58:24 GMT

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