質問

多分これは簡単な修正ですが、私が長い間狂って狂っているので、私はついに解決策が存在するかどうかを確認することにしました。

単に置く、私のWebページのほとんどのWebページを広いビューポートに中心にします。

例では、ビューポートは1028pxが可能であり、ページ幅は960pxだけにしたいです。

だから私のCSSは次のように見えます:

#pageWrapper { /* page width is 960 pixels */
    margin:0 auto;
    width:960px;
}
.

それに問題ありません。

Theの高さより短い動的ページを起動すると、ページの下部の(jQuery Slideoutなどを介して)展開され、垂直スクロールバーが表示されます。

スライドアウト中にページフリッカーを残し、スライディンの間にフリッカーを右にします。

は、CSSを通して20pxの正しいマージンを強制し、それでもmargin:0 auto;を利用していますか?

ありがとう。

役に立ちましたか?

解決

When the contents of the page no longer fit vertically, the browser adds a scrollbar to the right side of the window. This changes the available width in the browser window, so any content that is either centered or positioned relative to the right side of the window will move left a bit. This is very common.

There are a number of ways to control this, but the most common is to either make it so you always have a scrollbar or never have a scrollbar by controlling the overflow-y property on the window.

Setting overflow-y: scroll will force the scrollbars to always be there.

Setting overflow-y: hidden will force there to never be scrollbars.

他のヒント

NB: overflow-y: hidden prevents the user from scrolling down by any means, effectively rendering any content below the lower viewport inaccessible.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top