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

Re: [CSS21] 9.5.1: placing floats above earlier blocks & line boxes

From: Alan Gresley <alan@css-class.com>
Date: Fri, 15 Oct 2010 16:27:26 +1100
Message-ID: <4CB7E63E.8020402@css-class.com>
To: Anton Prowse <prowse@moonhenge.net>
CC: www-style@w3.org, Peter Moulder <peter.moulder@monash.edu>
Anton Prowse wrote:
> On 15/10/2010 03:36, Peter Moulder wrote:
>> I believe the initial example was correct and did use what Anton 
>> describes as
>> a wrapper box to have the negative margin.  I'd guess that the problem 
>> was just
>> that there wasn't enough whitespace to notice.  (And the fact that it 
>> would be
>> easy to forget to use a wrapper box for the negative margin.)
> My apologies; you correctly deduced that I scanned the last line too 
> quickly and didn't notice that the float:left was attached to a span 
> inside the p rather than to the p itself.
> Returning to your original post, then, I think you're confirming the UA 
> behaviour that was brought up in the other thread[1], but questioning 
> its worth since the float can "go upwards" but visually adjacent line 
> boxes are not shortened.  Specifically, you preferred the float to not 
> go upwards.
> What do you feel about the relationship between the float and its 
> surrounding text?  For example, in this case:
>   <p>Blah.</p>
>   <p>Blah.</p>
>   <p>Blah.</p>
>   <p>An earlier block and line box</p>
>   <p style="margin-top: -6em;">
>     text
>     <span style="float:left;">A float.</span>
>     text text text text text text text text text text text</p>
> in a sufficiently narrow container, should the float remain on the same 
> line as the "float placeholder" (a convenient device despite not 
> actually being part of the spec)?  In other words, if the float is 
> forced to "stay down", does the subsequent text stay down with it, 
> creating a gap between the previous line box and this one?  Or does the 
> float get placed lower than its placeholder?  I certainly dislike the 
> former, but even with the latter I don't really see the benefit since 
> the non-floated content of the p will be pulled upwards and overlap the 
> previous blocks even if the float is kept down.

I agree with what you saying but I don't believe that your test shows 
correctly what you are trying to express. Correct me if I am wrong.

<!DOCTYPE html>
<p>An earlier block and line box</p>
<p style="margin-top: -6em;border:1px solid red;background: 
     text text text text text text
     <span style="float:left;background: red;">A float.</span>
     text text text text text text text text text text text</p>

The first run of line boxes does stay in the same position as the 
"float placeholder" even when the float has dropped after the viewport 
is narrowed.

Alan http://css-class.com/

Armies Cannot Stop An Idea Whose Time Has Come. - Victor Hugo
Received on Friday, 15 October 2010 05:27:53 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:38:39 UTC