我有无法删除Firefox Quantum的滚动条的问题。哦,铬,它就像这个 css 的魅力一样工作:
div::-webkit-scrollbar {
border:none;
width:0;
background: rgba(0,0,0,0);
display: none;
overflow-x: hidden;
overflow-y: hidden;
}
div::-webkit-scrollbar-track {
border:none;
width:0;
background: rgba(0,0,0,0);
display: none;
overflow-x: hidden;
overflow-y: hidden;
}
div::-webkit-scrollbar-thumb {
border:none;
width:0;
background: rgba(0,0,0,0);
display: none;
overflow-x: hidden;
overflow-y: hidden;
}
我也尝试使用 jQuery 将其删除,并将其直接添加到正文标签中,如下所示style="overflow: hidden;"
这些都不起作用。看来我无法摆脱它们。如何删除它们?
编辑:
通过添加overflow: hidden;
.scroll-content{}
它删除了滚动条,但我无法再在 Firefox 上滚动了。如何启用溢出滚动:隐藏;
你可以做这样的事情。
<style>
#container{
height: 500px;
width: 200px;
background-color: #ccc;
overflow: hidden;
}
#container-inner{
width: calc(100% + 17px);
height: 100%;
overflow: scroll;
overflow-x: hidden;
}
.content{
width: 100%;
height: 300px;
}
.one{
background-color: red;
}
.two{
background-color: green;
}
.three{
background-color: yellow;
}
</style>
<div>
<div id="container">
<div id="container-inner">
<div class="content one">
</div>
<div class="content two">
</div>
<div class="content three">
</div>
</div>
</div>
</div>
我会创建一个小提琴,但现在 https://jsfiddle.net/下来了。