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