<!DOCTYPE html><html><head> <title></title> <style type="text/css">* { margin: 0px auto; padding: 0;}#wai { height: 200px; width: 500px; overflow: hidden; margin-top: 100px;}#box { height: 360px; width: 100%;background: #e7e7e7;overflow: hidden;}#box ul li { line-height: 40px; font-size: 25px; width: 400px; text-align: center; list-style: none; overflow: hidden;}</style></head><body> <div id="wai"> <div id="box"> <ul id="con1"> <li>1第一</li> <li>2第二</li> <li>3第三</li> <li>4第四</li> <li>5第五</li> <li>6第六</li> <li>7第七</li> <li>8第八</li> <li>9第九</li> </ul> <ul id="con2"></ul> </div> </div> </body><script type="text/javascript"> var box = document.getElementById('box'); box.scrollTop = 10;</script></html>
2 回答
一诺yinol
TA贡献27条经验 获得超4个赞
overflow:hidden; 截断了
#wai {
height: 200px;
width: 500px;
overflow: scroll;
margin-top: 100px;
}
#box {
height: 360px;
width: 100%;
background: #e7e7e7;
}
#box ul li {
line-height: 40px;
font-size: 25px;
width: 400px;
text-align: center;
list-style: none;
}
添加回答
举报
0/150
提交
取消