Page 1 of 1

Workaround for Mozilla/Firefox float bug?

Posted: Fri Jul 16, 2004 2:44 pm
by DCrazy
Alright, Mozilla and Firefox both have broken CSS "float" support. Don't believe me? Load up this page in Firefox-0.9.2 or Mozilla-1.7:

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Mozilla Float Test</title>
</head>
<body>
<div style="background-color: rgb(192, 192, 192);">
<div style="float: right; height: 10em; width: 5em; background-color: 
rgb(255, 255, 255); border: solid 1px rgb(0, 0, 0);">This is a floating div.  
It's height should stretch its parent's height.  
It's not supposed to be completely independent of its parent.</div>
This is a div.  It should stretch in height according to the height of its children.</div>
</body>
</html>
A real-world example can also be seen here. Note that Internet Explorer renders both examples according to the standard.

Does anyone know a workaround for this bug? I don't want to resort to using tables.

[edit]Wow, noticed another bug in Mozilla/Firefox... The floating div in my example doesn't stretch or clip the text, even though the text is too big for the frame. Strike two for Firefox.[/edit]

Posted: Fri Jul 16, 2004 2:53 pm
by Sapphire Wolf
Should this be in tech?

Posted: Fri Jul 16, 2004 2:55 pm
by DCrazy
It might get better exposure there but it is an HTML question. I'm looking for a CSS hack, not a browser option. But if I can't get an answer maybe I'll just move it there. :P

Posted: Fri Jul 16, 2004 4:57 pm
by fliptw
I think you looking at a bug in the border attribute, rather than the float attribute.

Opera renders it the same way as FireFox/Mozilla.

as I've read the float spec, all three browsers look to be rendering float correctly, and the test suite confirms as much.

Posted: Fri Jul 16, 2004 5:15 pm
by DCrazy
Crap. Re-reading the CSS spec, I see why. "The margins never collapse." :(

There are many similar (and some identical) bugs in Bugzilla though...

Posted: Fri Jul 16, 2004 7:48 pm
by Nirvana
IE

Posted: Fri Jul 16, 2004 8:14 pm
by Lothar
I see no difference between the puppies page rendered in IE 6.0 and Mozilla 1.5. What am I supposed to be seeing?

Posted: Wed Jul 21, 2004 9:21 pm
by DCrazy
The page has changed; a few days ago the bottom of the background stopped in the middle of that "males" section in Mozilla/Firefox.