Hidden scrollbars in Firefox (allows scrolling but just no scrollbar)

后端 未结 5 1871
日久生厌
日久生厌 2020-11-27 16:02

I\'d like to create a div that is able to scroll but does not display scrollbars. I have found a solution for Webkit (below) but how can this be done in other browsers?

相关标签:
5条回答
  • 2020-11-27 16:28

    For Edge:
    -ms-overflow-style: none;

    For Firefox:
    scrollbar-width: none;

    0 讨论(0)
  • 2020-11-27 16:39

    scrollbar-width:none

    Applied to the body or the element with scroll bar.

    Overflow:hidden

    also disables the scrolling function (makes content not scrollable)

    0 讨论(0)
  • 2020-11-27 16:39

    well, there`s a much more easy way! just put

        ::-webkit-scrollbar {
        width: 0px;
        height: 10px;
        }           
    

    in your css style and you're done with!

    0 讨论(0)
  • 2020-11-27 16:47

    You must wrap your scrollable div in another div with overflow:hidden that hides the scrollbar.

    See http://jsfiddle.net/qqPcb/ for an example.

    BTW: The same technique is used by a nice little jQuery plugin called jScrollPane

    0 讨论(0)
  • 2020-11-27 16:49

    2019 solution

    Since Firefox 64 there is a perfectly simple solution for this (working only in Firefox and Firefox mobile)

    scrollbar-width: none;
    

    Check the docs

    For the comers from the post marked as duplicate, there is also MS Edge solution:

    -ms-overflow-style: -ms-autohiding-scrollbar;
    
    0 讨论(0)
提交回复
热议问题