Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > margin-bottom not consistant with browsers

Reply
Thread Tools

margin-bottom not consistant with browsers

 
 
alice
Guest
Posts: n/a
 
      08-04-2007
I've got a div with a bottom margin of 12px. In IE7, the margin is in
fact 12 px, but in Firefox, it's 30 px. Can someone tell me what's
going on here and what I can do about it? I'm pretty sure it's not an
issue along the lines of "Firefox adds 18 px to all bottom margins",
so what type of issue is this?

 
Reply With Quote
 
 
 
 
dorayme
Guest
Posts: n/a
 
      08-04-2007
In article
< .com>,
alice <> wrote:

> I've got a div with a bottom margin of 12px. ...
> in Firefox, it's 30 px.


I'd like to see that!

--
dorayme
 
Reply With Quote
 
 
 
 
Neredbojias
Guest
Posts: n/a
 
      08-04-2007
Well bust mah britches and call me cheeky, on Sat, 04 Aug 2007 00:05:04 GMT
alice scribed:

> I've got a div with a bottom margin of 12px. In IE7, the margin is in
> fact 12 px, but in Firefox, it's 30 px. Can someone tell me what's
> going on here and what I can do about it? I'm pretty sure it's not an
> issue along the lines of "Firefox adds 18 px to all bottom margins",
> so what type of issue is this?


Probably an extra LF/CR from some source or t'other. Look for <br>s, esp.
at end or beginning of containers and how text flows therewithin.

--
Neredbojias
Half lies are worth twice as much as whole lies.
 
Reply With Quote
 
Ben C
Guest
Posts: n/a
 
      08-04-2007
On 2007-08-04, alice <> wrote:
> I've got a div with a bottom margin of 12px. In IE7, the margin is in
> fact 12 px, but in Firefox, it's 30 px. Can someone tell me what's
> going on here and what I can do about it? I'm pretty sure it's not an
> issue along the lines of "Firefox adds 18 px to all bottom margins",
> so what type of issue is this?


Could be margin-collapsing, which IE7 might get wrong (it is a little
complicated to understand). What kind of bottom margin does the div's
container have, and does the container also have zero bottom padding and
border?

This would give the effect you describe for example:

<body>
<div style="margin-bottom: 30px; background-color: red;">
<div style="margin-bottom: 18px; background-color: lavender">
Hello
</div>
</div>
world
</body>

You shouldn't be able to see any red, and there should be 30px between
the bottom of "Hello" and the top of "world".
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Browsers, browsers! Quo vadis? El Kabong HTML 23 05-13-2007 08:55 PM
Two Browsers work! Two browsers won't load. Internet game service won't load jimmie Computer Support 1 02-26-2006 08:36 AM
Links not consistant with Mozilla tshad HTML 2 04-21-2005 09:51 PM
How do you get consistant prints from a lab? hobart Digital Photography 12 11-07-2003 04:21 PM
Point and Click Weather Forecasts does not work on all browsers. Why not? Francis Ardi Java 3 07-10-2003 05:26 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57