【问题标题】:hide scroll bars on mozilla firefox在 Mozilla Firefox 上隐藏滚动条
【发布时间】:2017-01-06 11:33:11
【问题描述】:

我正在制作一个网络应用程序,但我似乎无法摆脱 Mozilla Firefox 上菜单的滚动条。它在我测试过的所有浏览器中都能完美运行,除了 Firefox。

这是我用于滚动的 css,目前在 Chrome、IE、Edge 和 Opera 中有效,但在 Firefox 中无效。

.main-sidebar{
        position:fixed
    }

    .bar{
        max-height: 400px; 
        overflow-y: scroll;
    }
    .bar::-webkit-scrollbar {
        display: none;
    }

    .bar {
        -ms-overflow-style: none; 
        overflow:hidden;
    }


    html {
        overflow: scroll;
        overflow-x: hidden;
    }
    ::-webkit-scrollbar {
        width: 0px;  /* remove scrollbar space */
        background: transparent;  /* optional: just make scrollbar invisible */
    }

.bar 是我希望隐藏滚动的 div 类。菜单滚动正常,但它没有隐藏在 Firefox 上。 有什么想法吗?

【问题讨论】:

    标签: javascript html css firefox scroll


    【解决方案1】:

    请尝试它对我来说很好。

    *{
       scrollbar-width: none;
     }
    

    【讨论】:

      【解决方案2】:

      在你的 webkit-scrollbar 上试试这个:

      ::-webkit-scrollbar { display: none; }
      

      它应该可以工作。

      【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-06-01
      • 2013-03-01
      • 2011-02-22
      • 2013-11-04
      • 1970-01-01
      • 2020-04-20
      相关资源
      最近更新 更多