By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,885 Members | 1,072 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,885 IT Pros & Developers. It's quick & easy.

Margins not correct in Firefox

P: n/a
Can someone tell me how I can make it so that on this page
http://s195679515.onlinehome.us/essence/index.html
in Firefox, the space after the main content and the bottom boxes is
only 5px? As it is now, it seems as though the Firefox is adding extra
pixels, which I can't seem to find where in my code that is coming
from. I've tried getting rid of the clear property of the div
(#block), but that moves part of it up to the top of the screen.

Sep 19 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
alice wrote:
Can someone tell me how I can make it so that on this page
http://s195679515.onlinehome.us/essence/index.html in Firefox, the
space after the main content and the bottom boxes is only 5px? As it
is now, it seems as though the Firefox is adding extra pixels, which
I can't seem to find where in my code that is coming from. I've tried
getting rid of the clear property of the div (#block), but that moves
part of it up to the top of the screen.
Before you start looking for 5 pixels, maybe if you fixed some of the
errors, the page would work as you think it should.

<http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fs195679515.online home.us%2Fessence%2Findex.php>
"Failed validation, 81 Errors"

New pages should be Strict, rather than Transitional, and unless you
have a compelling reason to use XHTML, should be HTML 4.01

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

You will want to look into this as well:
http://k75s.home.att.net/fontsize.html

--
-bts
-Motorcycles defy gravity; cars just suck
Sep 19 '07 #2

P: n/a
alice wrote:
Can someone tell me how I can make it so that on this page
http://s195679515.onlinehome.us/essence/index.html
in Firefox, the space after the main content and the bottom boxes is
only 5px? As it is now, it seems as though the Firefox is adding extra
pixels, which I can't seem to find where in my code that is coming
from. I've tried getting rid of the clear property of the div
(#block), but that moves part of it up to the top of the screen.
Get rid of the margin-bottom: 5px from either #fill or #swap .

--
Beware of bugs in the above code; I have only proved it correct, not
tried it. -- Donald E. Knuth
Sep 19 '07 #3

P: n/a
On 2007-09-19, alice <al***@fearofdolls.comwrote:
Can someone tell me how I can make it so that on this page
http://s195679515.onlinehome.us/essence/index.html
in Firefox, the space after the main content and the bottom boxes is
only 5px? As it is now, it seems as though the Firefox is adding extra
pixels, which I can't seem to find where in my code that is coming
from. I've tried getting rid of the clear property of the div
(#block), but that moves part of it up to the top of the screen.
What browser are you comparing it with? I think the total gap of 10px is
correct. You've got #swap with 5px bottom margin followed by #fill with
another 5px bottom margin. Both are floats, so those margins should not
collapse even though #fill has zero-height.

The following box has clear set on it so it should correctly clear to
below the preceding bottom margin (although it might lose some of its
top margin if it had any).

You are relying on quite a few tricky rules here though. It's possible
you put #fill in in the first place because some other browser was
incorrectly not clearing the bottom margin of #swap.

If you use padding instead of margins there are fewer rules to worry
about-- padding doesn't collapse and isn't involved in the specification
of clear the way margin is. You could try giving #swap padding-bottom of
5px, and no bottom margin, and getting rid of #fill altogether. That
should work in Firefox and hopefully also in whatever else you're
testing in.
Sep 20 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.