Претражи подршку

Избегните преваре подршке. Никада од вас нећемо тражити да зовете или шаљете поруке на број или да делите личне податке. Пријавите сумњиве радње преко „Пријавите злоупотребу” опције.

Learn More

Firefox 4 element seems to gain top margin when only bottom margin is set.

  • 1 одговор
  • 14 има овај проблем
  • 6 прегледа
  • Последњи одговор послао dponinski

more options

I've been working on blocking out a page layout, and after I upgraded to Firefox 4 I noticed that a central element containing 3 floating elements and a clearing div suddenly started gaining spacing where the top margin would be whenever the bottom margin was set. One can bypass the problem by either giving the clearing div a height somehow or by using padding instead, but I want to know if this is a bug or that I'm just missing something. This behavior is not duplicated in any other browser I've tried including IE6.

I have set up a demo at http://jacobanderson.us/projects/bugs/firefox4margintest.html - if you edit the bottom margin of the "body .page .content .keynote" element in Firefox 4 you'll see that the entire element gains spacing on both the bottom and top equally. The same effect can be triggered by adding a top margin to the "body .page .content .columns" element.

I've been working on blocking out a page layout, and after I upgraded to Firefox 4 I noticed that a central element containing 3 floating elements and a clearing div suddenly started gaining spacing where the top margin would be whenever the bottom margin was set. One can bypass the problem by either giving the clearing div a height somehow or by using padding instead, but I want to know if this is a bug or that I'm just missing something. This behavior is not duplicated in any other browser I've tried including IE6. I have set up a demo at http://jacobanderson.us/projects/bugs/firefox4margintest.html - if you edit the bottom margin of the "body .page .content .keynote" element in Firefox 4 you'll see that the entire element gains spacing on both the bottom and top equally. The same effect can be triggered by adding a top margin to the "body .page .content .columns" element.

Сви одговори (1)

more options

I seemed to have solved the issue with the margin on the top and bottom. Just float the header and footer left. You might need to clear left or right depending on your layout but that did the trick for me. Hope this helps.