Previous Message
Next Message

[css-d] Re: any w3c plan to fix the float spec?

Sent by stylo~ on 11 August 2002 06:06


<p>
<img src="blah.gif" style="float: left; height: 100px; width: 50px;">
This is a short paragraph.
</p>
<p>
Lorem ipsum, dolor sit amet, consectetuer adipiscing elit, sed diam
nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat
volutpat. </p>

>Would you expect a whole lot of white space between the sentence
"This is a short paragraph." and the beginning of the next paragraph?
That certainly isn't how Web browsers have acted for years now.
Instead, content always flows around floats, no matter if the content
appeared in later elements or not.
> In order to reproduce that behavior, the CSS float rules had to be
written as they are now.
************************

I don't get that at all, Eric.  What I would want if I coded that would be
for the floated IMG not to pop out of the P container I *put it in*, but for
the P to expand to contain it. The second P would then sit below the first
P. The desired behavior is easy to produce: if I wanted all the text close
together alongside the IMG, I would take the IMG out of the P container and
float the IMG left and the Ps would line up alongside it.

I still can't think of a single instance of the w3c float behavior being
desirable, and, in any case, if one is thought of, any where near as
desirable as having the container *contain* its floats and thus avoid the
need to stick in garbage code to force what is desired. This need is most
evident when you have borders on the container such as the P in your
example.

If clear:left or something worked on the floated element to force the
container to stretch, that would work, but just require an extra line
unnecessarily. The float spec seems horribly designed unless there is
something more I'm not considering.

I'll look at the css3 draft, thanks, but, while I hear many complaints about
this behavior, I've never heard of a proposed change.

stylo~
Previous Message
Next Message

Possibly related: