I see a formatting error in Firefox 3.5.3 when I include jQuery 1.3.2
on a page even though I have not added any JavaScript of my own. A
paragraph element that is placed after an image is not honoring the
margin-top CSS parameter. The HTML and CSS are valid, and if I remove
the jQuery library, the margin-top works properly. I can adjust the
CSS a couple different ways to avoid the problem, but those changes
are not desirable (they don't provide the same result).

It seems like something in the jQuery initialization code is
interacting with some aspect of Firefox 3 and producing the incorrect
result when the page is fetched for the first time. Refreshing the
page corrects the problem.

In case it's not obvious, I need the jQuery library because the actual
page has scripting. I stripped that out while diagnosing the problem.

I've created a test page (URL below) that has only the bare
essentials, but please note that it takes a bit of care to see the
problem. Various things that should not affect the formatting of the
page, such as refreshing the page, will alter the page format and the
page will look right. If it looks right to you, you can try clearing
the FF3 cache, quitting Firefox, and refetching the page. That usually
works to show the issue.

The page shows the same image twice. The first image has a caption
that is right below the image, which is not right. The second image
has a 1em margin between the bottom of the image and top of the
paragraph text, which is the desired outcome.

To make the second image and caption work properly, I removed padding
from the element that encloses the IMG and P elements. That shouldn't
affect the margin on the P element, but it does. As explained above,
other tweaks like that can be used to avoid the problem, but they
affect what I am trying to do on the actual page.

Test page: http://www.johncardinal.com/tests/caption.htm

The test page references jQuery 1.3.2 via "googleapis.com" but that
doesn't matter; the problem was still there when I tested with a local
copy of jQuery.

Thanks in advance... I've been beating my head against the wall on
this one.

Reply via email to