在开发过程中遇到这样一个问题,在一个service cart里面需要显示出很多service项.
所以想着在div标签里添加滚动条.
直接为div的overflow指定为auto即可.这样做,但是必须指定div的高度.
<div style="position:absolute; height:400px; overflow:auto"></div>
如果要出现水平滚动条:overflow-x:auto
如果要出现垂直滚动条:overflow-y:auto
如果该div被包含在其他对象例如td中,则位置可设为相对:position:relative
author:jack.lee
date:2012.01.09
contact method:qq-523072842
Thanks!
There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.