Hiding the scroll bar in MS Edge and Firefox? [duplicate]

心已入冬 提交于 2019-12-08 11:14:58

问题


I have a scrollable menu, which needs to be scrollable. I hide the scroll bar in Chrome by using:

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

Which works. What is the same for Firefox and MS Edge that will do the same?

Thanks


回答1:


What about overflow-y: auto? That should show the scrollbar only when the menu is longer than the viewport.




回答2:


The standard way to hide scrollbars is with overflow: hidden;, you can still scroll with a mouse's scroll-wheel or trackpad scroll gesture, or by setting the element's scroll properties with JavaScript.




回答3:


On your website, when I open IE's F12 pane and select <div class="menu..."> and change overflow-y: scroll; to overflow-y: none; it renders as you want it.

You don't need webkit-specific rules at all.



来源:https://stackoverflow.com/questions/32725112/hiding-the-scroll-bar-in-ms-edge-and-firefox

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!