我使用overflow:scroll像下面的代碼一樣,我遇到的問題是,即使沒有文本,滾動條仍然顯示。
w3schools上的演示:http://www.w3schools.com/cssref/tryit.asp?filename=trycss_overflow 即使您不能水平滾動(左側或右側),仍然會出現滾動條。我想有它在那裏,如果沒有什麼滾動to.hope這是有道理的即使沒有什麼可滾動,css溢出滾動條也會出現
<style type="text/css">
div.scroll {
background-color: #00FFFF;
width: 100px;
height: 100px;
overflow: scroll;
}
</style>
<p>overflow:scroll</p>
<div class="scroll">You can use the overflow property when you want to have better control of the layout. The default value is visible.</div>
我相信它在該演示中被禁用,因爲沒有什麼可滾動? – antonpug 2012-04-17 17:25:51