W3C home > Mailing lists > Public > www-style@w3.org > July 2003

Re: interpretation of float model - Mozilla vs Opera & IE

From: Chavchanidze Giorgi <chav@ictp.trieste.it>
Date: Mon, 21 Jul 2003 21:23:16 +0200 (MET DST)
Message-ID: <3331.10.41.38.26.1058815396.squirrel@mailhost.ictp.trieste.it>
To: www-style@w3.org

>> > Mozilla's rendering is correct.  Safari also puts the second float  
>> > below the first.
>> Opera 7 does the same, but CSS2.1 says:
>> 10.3.5 Floating, non-replaced elements
>> If 'left', 'right', 'margin-left', or 'margin-right' are specified as 
>> 'auto', their computed value is '0'. 
>> If 'width' is specified as 'auto', the computed value is the
>> "shrink-to-fit"  width. 
>> Calculation of the shrink-to-fit width is similar to computing the
>> width of  a table cell using the automatic table layout algorithm.
>> 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.
>> Thirdly, compute the available width: in this  case, this is the width
>> of the containing block minus 'left', 'right',  'margin-left' and
>> 'margin-right'. (Omit 'left' and 'right' if they do not  apply to this
>> element.) 
>> Then the shrink-to-fit width is: min(max(preferred minimum width,
>> available  width), preferred width).
> Did you read this text?  This is describing exactly what Mozilla is
> doing.  Note that available width in this context is defined based on
> the width of the containing block and has nothing to do with any other
> floats on the page.
Sorry, I misinterpreted definition of prefered width. So Opera, Mozilla and 
Konqueror/Safari seem to handle it correctly.
Received on Monday, 21 July 2003 15:23:18 GMT

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