html去除页面的滑动条

https://blog.csdn.net/WzhCsdnd/article/details/129465827

1、在<body>里直接加入,可隐藏滚动条;

例如:
<body scroll="no">,隐藏滚动条;
<body scroll="auto">宽度或高度大于页面的宽或高时,不显示滚动条,反之,则显示;
<body style="overflow-x:hidden"> 可隐藏水平滚动条;
<body style="overflow-y:hidden"> 可隐藏垂直滚动条。
2、另一种方法,写在<style type="text/css">中

<style type="text/css">
body {
scroll="no"
scroll="auto"
overflow-x:hidden;
overflow-y:hidden;
}
</style>

<style type="text/css">
html {
scroll="no"
scroll="auto"
overflow-x:hidden;
overflow-y:hidden;
}

————————————————
版权声明:本文为CSDN博主「Dear Wang.」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/WzhCsdnd/article/details/129465827

posted @ 2023-06-26 13:52  yinghualeihenmei  阅读(79)  评论(0编辑  收藏  举报