HTML页面缩小后如何有横向滚动条

2025-04-03 22:41:35
推荐回答(1个)
回答1:

overflow:scroll; /*任何时候都强制显示滚动条*/
overflow:auto; /*需要的时候会出现滚动条*/
overflow-x:auto; /*控制X方向的滚动条*/
overflow-y:auto; /*控制Y方向的滚动条*/
示例:


测试表格内的滚动条










表格内的滚动条:
style="position:absolute;height:200;width:200;overflow:auto;background:#EEEEEE;">

pppppppppppppppppppppppppppppppppppppppppppppppppp


pppppppppppppppppppppppppppppppppppppppppppppppppp


ppppppppppppppppppppppppp


ppppppppppppppppppppppppp


ppppppppppppppppppppppppp


ppppppppppppppppppppppppp


ppppppppppppppppppppppppp


ppppppppppppppppppppppppp


ppppppppppppppppppppppppp


ppppppppppppppppppppppppp


ppppppppppppppppppppppppp


ppppppppppppppppppppppppp




onmouseout=clearInterval(scrollb)>向左
onmouseout=clearInterval(scrollb)>向上
onmouseout=clearInterval(scrollb)>向右
onmouseout=clearInterval(scrollb)>向下