You are here: Re: margin-bottom not consistant with browsers « HTML « IT news, forums, messages
Re: margin-bottom not consistant with browsers

Posted by Ben C on 08/04/07 08:21

On 2007-08-04, alice <alice@fearofdolls.com> 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".

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация