0

フィドルの下では、スクロールバーはフィドルの上部にあります。スクロールバーをテキストの最初の要素と同じレベルにする必要がありますが、スクロールバーを垂直方向に 40 ピクセル下に移動します。

http://jsfiddle.net/ebLSe/7/

スクロールバーをそれ自体に揃えるCSSオプションはありますか?

フィドルコード:

    <div class="scroll">
    <table  >
      <tr><td>
        test
        </tr></td>
        <tr><td>
        test
        </tr></td>
        <tr><td>
        test
        </tr></td>
        <tr><td>
        test
        </tr></td>
      </table>
    </div>

   .scroll {
    height: 80px;
    overflow-y:scroll;
}

.modeDown {
  padding-top: 100px;
}
4

1 に答える 1

1

Your text is further down the div as you have given the .scroll top padding of 40px. If you change this value, your text will move further up the div. You may also need to change the height as at the moment your div has a height of 80px (40px height plus 40px padding).

To keep the div further down the page then you need to add either margin-top:40px to .scroll or you can put it in an extra div with a padding top of 40px

.scroll {
    margin-top:40px;
    height: 80px;
    overflow-y: scroll;
}
于 2013-01-14T14:12:44.933 に答える