问题
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