Re: [CSS 2.1] [section 9.5 Floats] Empty floated element with a set width but height:0

Some further information:

We agree that a zero-height float (or a float whos bottom edge is
incident with the top edge of a line box) doesn't force the line box
out of the way in any browser.

A further question concerns zero-height floats which appear in the
middle of a line.  For example:

<!DOCTYPE html>
<div style="float:left; width:50px; height:5px; background:blue;"></div>
<div style="float:left; clear:left; width:100px; height:0px;"></div>
<span>foo</span>

The first float definitely shoves the text over by 50px.  The question
is whether the 0-height float should further push it or not.

Chrome doesn't push it, but that's part of a general bug where Webkit
doesn't take into account floats that don't intersect the top of the
line box.  (Make the second float 5px hight and give it a background
to see what I mean.)  So it's a wash, and tells us nothing.

Firefox doesn't push the text.

IE and Opera push the text.

If I'm recalling correctly (doesn't look like the comment made it into
the minutes today), Dbaron said he'd be willing to change the Firefox
behavior here (but it may make his current implementation strategy
slightly more difficult).

~TJ

Received on Wednesday, 4 August 2010 22:35:54 UTC