Funkcjonalność tej witryny będzie ograniczona w czasie konserwacji. Jeśli artykuł nie rozwiązuje twojego problemu i chcesz zadać pytanie, to nasza społeczność wsparcia jest dostępna na @FirefoxSupport na Twitterze i /r/firefox na Reddicie.

Przeszukaj pomoc

Unikaj oszustw związanych z pomocą.Nigdy nie będziemy prosić Cię o dzwonienie na numer telefonu, wysyłanie SMS-ów ani o udostępnianie danych osobowych. Zgłoś podejrzaną aktywność, korzystając z opcji „Zgłoś nadużycie”.

Więcej informacji

How to prevent most page content from shifting right?

  • 8 odpowiedzi
  • 2 osoby mają ten problem
  • 2 wyświetlenia
  • Ostatnia odpowiedź od brianInVancouver

more options
I am have no problem viewing page http://konicaminolta.ca/business/index.html in Firefox. However, some site visitors using the same browser (Firefox version 25) and same OS find most page content very right-shifted. This right-shifting appears to take place within the
section, and does not appear within IE or Chrome. I'd post a screen shot if I had this option.
I am have no problem viewing page http://konicaminolta.ca/business/index.html in Firefox. However, some site visitors using the same browser (Firefox version 25) and same OS find most page content very right-shifted. This right-shifting appears to take place within the <div id="contentsArea"> section, and does not appear within IE or Chrome. I'd post a screen shot if I had this option.

Wybrane rozwiązanie

The <div id="bodyArea"> needs style="width:100%". I'm not sure why, but it is shrinking to fit the floated content.

The <div id="contentsArea"> is floated to the right and has style="width:100%" but Firefox computes width relative to the parent element, <div id="bodyArea">, and that apparently is indeterminate and needs to be set explicitly.

Actually, it is shrinking to float up next to the blank area of the navigation bar. See cor-el's reply: https://support.mozilla.org/en-US/questions/978904#answer-506108

Przeczytaj tę odpowiedź w całym kontekście 👍 1

Wszystkie odpowiedzi (8)

more options

If you have a screen shot, that would be great. You can attach it to a reply, using the "Browse" button below the text box.

more options

Wybrane rozwiązanie

The <div id="bodyArea"> needs style="width:100%". I'm not sure why, but it is shrinking to fit the floated content.

The <div id="contentsArea"> is floated to the right and has style="width:100%" but Firefox computes width relative to the parent element, <div id="bodyArea">, and that apparently is indeterminate and needs to be set explicitly.

Actually, it is shrinking to float up next to the blank area of the navigation bar. See cor-el's reply: https://support.mozilla.org/en-US/questions/978904#answer-506108

Zmodyfikowany przez jscher2000 - Support Volunteer w dniu

more options
I meant to say this right-shifting appears to take place within the
section, and wonder if it's jQuery-related.
more options

Another solution, which does not require a width rule for bodyArea, is to remove the overflow:hidden rule from bodyArea.

To ensure that bodyArea fully "contains" contentsArea, which resolves a strange issue with some horizontal lines, you can use one of the classic float containment tricks, such as placing a clearing div as the last element on bodyArea:

<div style="clear:both"></div>

Edit: best solution is: https://support.mozilla.org/en-US/questions/978904#answer-506108

Zmodyfikowany przez jscher2000 - Support Volunteer w dniu

more options

Screen shots related to that last reply:

  • with overflow:hidden rule as served
  • turning off that rule so the default overflow:visible is applied
  • adding a clearing div at the end of bodyArea (using DOM Inspector extension)
more options

Adding #bodyArea {clear:both} works for me.

more options

Hi cor-el, yes, you're right, that is the simplest solution.

I hadn't noticed the coincidence of the width of the content and the remaining blank area on the navigation bar.

Maybe some users have additional content on the bar, e.g., menus only available to logged in users, so when it was tested, the problem wasn't noticed because the bar was fully occupied??

more options

Thank you jscher2000 and cor-el so much!

Explicitly setting bodyArea width to 100% solved this problem some users experienced using our site. I didn't have an opportunity to try #bodyArea {clear:both} because I can't replicate this issue on my computer.

Zmodyfikowany przez brianInVancouver w dniu