Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/41.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ssis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在css中使用溢出时隐藏或删除滚动边栏?_Css - Fatal编程技术网

如何在css中使用溢出时隐藏或删除滚动边栏?

如何在css中使用溢出时隐藏或删除滚动边栏?,css,Css,我有一个burger类,我想使用overflow属性来滚动。但当我使用它时,它看起来是这样的: 我希望有那种滚动效果,但同时,我不希望那些滚动条出现在侧面: 这是我的css类: .Burger { width: 100%; margin: auto; height: 250px; text-align: center; overflow: scroll; font-weight: bold; font-size: 1.2rem; }

我有一个burger类,我想使用
overflow
属性来滚动。但当我使用它时,它看起来是这样的:

我希望有那种滚动效果,但同时,我不希望那些滚动条出现在侧面:

这是我的css类:

.Burger
{
    width: 100%;
    margin: auto;
    height: 250px;
    text-align: center;
    overflow: scroll;
    font-weight: bold;
    font-size: 1.2rem;
}
有人知道我还可以在这些属性中添加什么来隐藏那一边的滚动条吗。我想让情感出现,但不是酒吧,就像这样:


隐藏滚动条但保持滚动 将此添加到您的代码中

/* Hide scrollbar for Chrome, Safari and Opera */
.Burger::-webkit-scrollbar {
  display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
.Burger {
  overflow-y: scroll; /* Add the ability to scroll */
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}
你也看到了吗

以及的浏览器兼容性

试试这个我想如果这是你想要的


可以将溢出设置为自动,而不是滚动。
.burger{
  overflow: scroll; /* Add the ability to scroll */
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */

}

/* Hide scrollbar */
.burger::-webkit-scrollbar {
    display: none;
}