1

以下は非常にシンプルなリキッド コード テンプレートです。大きなモニターでこのレイアウトが広くなりすぎないようにしています。コンテナーは他のすべての div を囲み、パーセンテージ ベースの幅を与えます。

body {
    font:  Arial, Helvetica, sans-serif;
    background: #CCC;
    margin: 0;
    padding: 0;
    color: #000;
}

.container {
    width: 90%;
    max-width: 1260px;
    min-width: 780px;
    background: #FFF;
    margin: 0 auto; 
}

コンテンツの少ないページをブラウジングする場合、ボディが縮んだり、移動したり、揺れたりすることはありません (スクロールバーが表示されないため)。異なる種類のページ間をブラウジングすると (ロー コンテンツ - スクロールバーが表示されず、ハイ コンテンツ - スクロールバーが表示される)、ボディが少し移動し、Web サイト全体がブラウジングして表示が揺れます。

上記のページ移動を回避するには?overflow:scroll;スクロールバーを常に表示したくないので、設定で解決したくありません。

どんな助けでも大歓迎です、ありがとう、マイク

4

1 に答える 1

-1

Have you tried overflow: auto;? It will take both the X and Y scroll bars into account separately and only show the scroll bar if necessary.

If, as @pinkgothic suggested in the comments below, you want to always show the vertical scroll bar, try overflow-y: scroll;.

To always hide the horizontal scrollbar, use overflow-x: hidden;

于 2012-04-05T14:06:45.047 に答える