如何解决热门使用::-webkit-scrollbar来隐藏水平条或垂直条的单个方向吗?
::-webkit-scrollbar{
height:0px
width:0px;
}
// hides both vertical and horizontal scrollbar
如何使用它仅隐藏垂直或水平方向?不是两个方向
我想隐藏垂直滚动,但仍然可以使用,溢出隐藏功能会禁用滚动
解决方法
这是隐藏滚动条的解决方案
html {
scrollbar-width: none; /* For Firefox */
-ms-overflow-style: none; /* For Internet Explorer and Edge */
}
html::-webkit-scrollbar {
width: 0px; /* For Chrome,Safari,and Opera */
}
html
可以替换为要隐藏其滚动条的任何元素。
over-flow: hidden;
overflow-x: auto;
和
over-flow: hidden;
overflow-y: auto;
,
在-webkit-scrollbar
中,width
值用于竖线,height
值用于水平线。
html::-webkit-scrollbar {
width: 5px;
height: 0px; /* If value is 0px,the horizontal bar will disappear but still works*/
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。