本文介绍了固定的定位bug在Firefox 7.0.1,一些溢出似乎导致固定的div 1px margin的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这似乎是一个特定于firefox(版本7.0.1)的错误,我已将违规代码复制到jsFiddle。



但jsFiddle REPRODUCE THE BUG 。将代码从jsFiddle复制到一个空白的html文档并在本地测试它以查看问题。




资料来源: HelloJoe


他的解决方案从上一个线程,这是一个固定的一切的原因。 :)


This seems to be a bug specific to firefox (version 7.0.1), I have copied the offending code into jsFiddle.

but jsFiddle DOES NOT REPRODUCE THE BUG. copy the code from jsFiddle into a blank html document and test it locally to see the issue.

http://jsfiddle.net/kCMeu/1/

This is the normal state of the menu items before you over over any of them:

This is the first sub_item when hovered over wiht the mouse:

And the third sub_item:

And now the last:

Where did that white margin come from around the #global_nav_box div? it only shows up on the hover state of the last sub item.

That is the bug I cant (conveniently) fix.

Fixes I've found are:Setting the body tag 'margin-top:0px' - but that leave an unsightly margin on the left and right of the page.Removing the 'z-index' property from the CSS for #global_nav_box - I thought i'd fixed it, until all the content on the page below scrolled over the div when you scroll on the page.

So why does it do this? Can you replicate this on Firefox? How can I fix it?

Thanks in advance.


Update: Ive had some of my friends test it and it (the bug) shows up for some and not for others, I have also tested in in Windows XP mode and it (the bug) still doesn't show up. All my testers were running Windows 7 and Firefox 7.0.1.

I've disabled all plugins and extensions on my install of Firefox and its still there. Insane.

解决方案

Although I do not know what caused this issue I have found a clean solution for it :)

His solution from the previous thread that was the cause for this one fixed everything. :)

这篇关于固定的定位bug在Firefox 7.0.1,一些溢出似乎导致固定的div 1px margin的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-02 17:25