Forum Moderators: open
In a nutshell, I had a div with a 185px top margin. It was floated to the left, and contained a few more floated divs.
Below this floated container div, I had a footer div with clear:both set. This footer contained a banner image set to display:block.
For some reason, FireFox was pushing my container div down on the page by about the height of the banner image in the footer. Setting the footer banner to display:inline fixed the problem beautifully.
This happened identically with a Strict and a Transitional HTML 4.01 doctype.
I'm including the code in case anyone else is interested in this. Is this a known bug or have I discovered something new? ;) And does anyone know what might have triggered the bug? I sure appreciate any light that can be thrown onto this issue!
Anyway, here's the relevant code:
<style type="text/css">#cont1 {
margin-top: 185px;
padding: 10px;
float: left;
width: 755px;
}#footer {
clear: both;
text-align: center;
}#footer img {
margin: 30px auto;
display: block;
}</style><body>
<div id="cont1">
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Fusce leo augue, consequat a, aliquam non, convallis id, sem. Ut sed purus eu elit viverra dignissim. Donec sollicitudin suscipit odio. Sed convallis ultrices odio. Donec blandit, est ut vestibulum elementum, tortor ligula pretium odio, vitae imperdiet tortor erat sed ipsum.
</div><div id="footer">
<img src="/path/to/image.gif">
</div></body>
I switched the image display to inline too, with no difference. Also tried an XHTML doctype and no doctype at all, and again no difference.
Using Firefox 0.9.3 on Linux.
I'll sticky you a URL you can see this in action.
<div container>
<div sub>
<h1>
will in certain circumstances for example take the undeclared h1 top margin and put it over div sub, that's just one example, but it's all the same bug.
However, this is the only real gecko bug I've found on any recent projects, wish I could say the same for Opera and IE. And I'm not talking about out there CSS 3, I'm talking basic CSS 1/2 stuff.
So one bug is ok to me, although it would be nice if the gecko people could get it fixed before Firefox 1.0 comes out.