We're calling on all EU-based Mozillians with iOS or iPadOS devices to help us monitor Apple’s new browser choice screens. Join the effort to hold Big Tech to account!

搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

My HTML code works fine in IE8 but pages "jump" slightly to the right and left in Firefox

  • 6 回覆
  • 13 有這個問題
  • 1 次檢視
  • 最近回覆由 cor-el

more options

I have created a website that looks and works fine in IE8 but in Firefox some of the pages jump a couple of pixels to the left. I have tried to debug it but cannot find any coding errors.

I have created a website that looks and works fine in IE8 but in Firefox some of the pages jump a couple of pixels to the left. I have tried to debug it but cannot find any coding errors.

被選擇的解決方法

You can force a vertical scroll bar with body {overflow-y: scroll}

從原來的回覆中察看解決方案 👍 2

所有回覆 (6)

more options

Try posting at the Web Development / Standards Evangelism forum at MozillaZine. The helpers over there are more knowledgeable about web page development issues with Firefox.
http://forums.mozillazine.org/viewforum.php?f=25
You'll need to register and login to be able to post in that forum.

more options

Be sure to add a link to that website in your post.
Firefox uses a default margin of 8px in the body. If you do not want that margin then add this style rule:

body {margin: 0px}

There may be other difference depending on the DOCTYPE that you specify (or omit).

more options

After hours and hours of removing code and content, I finally figured out why it is jumping from one page to another (and it's a bit embarrassing to admit): the %!&#? scroll bar's absence or presence shifts the page that many pixels to the right and left!!! This doesn't happen in IE because it is always there, whether used or not. Does anyone know how to "fix" this "problem" in Firefox? I think it looks really clunky for it to jump left and right depending on which page on my site you click on.

more options

選擇的解決方法

You can force a vertical scroll bar with body {overflow-y: scroll}

more options

Thanks for the tip cor-el. That solved my problem! Looks much better now.