Forum Moderators: open

Message Too Old, No Replies

New Mozilla Bug?

Well, it's new to me, at least.

         

MatthewHSE

7:46 pm on Aug 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I just had a very strange experience. While I normally experience high blood pressure trying to debug CSS layouts for IE, I just finished a bout of frustration on something that, surprise surprise, actually worked correctly in IE but was broken in FireFox.

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>

encyclo

8:35 pm on Aug 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I can't seem to reproduce this with the markup you've given, MatthewHSE. Are you saying that the Lorem ipsum text was moved down the page further than the 185px?

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.

MatthewHSE

2:17 am on Aug 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well now I can't duplicate it either. But I definitely isolated that display:block on the footer image to be the problem before. Perhaps there's some other page element on my actual page that's interfering somehow. I guess I should try a more thorough debugging job when I have the opportunity.

I'll sticky you a URL you can see this in action.

isitreal

2:31 am on Aug 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



That's a known mozilla bug, it's the only real one I've had trouble with, Gecko will take a margin occuring elsewhere on the page and put it on top, it can be resolved by putting the margin elsewhere, or by using absolute positioning, or several other ways, but it is a bug.

<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.

MatthewHSE

1:57 pm on Aug 16, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Glad to hear I'm not going crazy on this one! On the other hand, <weeping>, it hurts to find that my favorite browser has flaws! ;)

isitreal

7:51 pm on Aug 17, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The bug is still there in Gecko 1.7, I saw it again on a new site I did, in this case it was the <h1> top margin that was incorrectly placed as the top margin of the <h1> container <div>. I forgot to check if the bug is fixed in gecko 1.8, I should have before putting in the css fix.

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.

drbrain

8:33 pm on Aug 17, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Can anyone get me a reliable testcase? I'll look through bugzilla to see if I can find a bug id.