Pringle, Ron wrote:
>  
>> Ingo Chao wrote:
>>> <div style="float: left; height:100px; width:100px; background: 
>>> yellow;"></div>
>>>
>>> <div style="float: left;">
>>>    <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam 
>>> luctus urna non sem.</p>
>>> </div>
>>>
>>> If the window is wide enough, the Lorem ipsum stays next to 
>> the yellow 
>>> float. But if the window is narrowed, the Lorem ipsum does 
>> not wrap, it 
>>> just drops under the float. It wraps in IE.
>> http://www.w3.org/TR/CSS21/visudet.html#q8
>> The available width for the second float is the width of the 
>> containing block.
> 
> I still don't understand why the second floated div, given enough room,
> would fail to float up next to the first floated div, given the
> following from the link you provided:
> 
> "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." [0]
> 
> I'm probably being obtuse, but it appears that the minimum width needed
> should be the width of the floated div with all possible line breaks,
> which should be fairly narrow with normal next.

I think it doesn't matter how narrow the preferred minimum width is, 
because this min-width is compared with a max-relationship to the 
available width:

"Then the shrink-to-fit width is:
min(max(preferred minimum width, available width), preferred width)."[0]
[0] http://www.w3.org/TR/CSS21/visudet.html#q8


meaning that the inner parenthesis

max(preferred minimum width, available width)
= max (with all possible line breaks, width of containing block)
= max (width of the widest word, width of containing block)
= width of containing block

inserted into the outer parenthesis

min(width of containing block, preferred width)
= min(width of containing block, all the words from "Lorem"..."vestibulum")

= width of containing block

shrink-to-fit width = width of containing block
in your example.

In my example above, it's possible to have the loremipsum right to the 
yellow float, because it is a short paragraph, which can be narrower 
than the containing block, if the window is wide enough.

shrink-to-fit width = width of all the words

And if I am wrong, it doesn't matter, because no one reads a post with 
more than one formula.


Ingo

-- 
http://www.satzansatz.de/css.html
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to