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

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

From: Anton Prowse <prowse@moonhenge.net>
Date: Fri, 15 Oct 2010 05:35:08 +0100
Message-ID: <4CB7D9FC.4000204@moonhenge.net>
To: www-style@w3.org
CC: Peter Moulder <peter.moulder@monash.edu>
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.

On the whole, I think I'm happy with not special-casing floats here; 
overlap of the content of the p is a natural consequence of the negative 
top margin.

[1] http://lists.w3.org/Archives/Public/www-style/2010Sep/0148.html

Cheers,
Anton Prowse
http://dev.moonhenge.net
Received on Friday, 15 October 2010 04:35:54 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:32 GMT