Hide scroll bar, but while still being able to scroll

前端 未结 30 3406
悲哀的现实
悲哀的现实 2020-11-21 04:22

I want to be able to scroll through the whole page, but without the scrollbar being shown.

In Google Chrome it\'s:

::-webkit-scrollbar {
    display:         


        
30条回答
  •  别那么骄傲
    2020-11-21 04:47

    Use:

    My scroll-able area

    This is a trick to somewhat overlap the scrollbar with an overlapping div which doesn't have any scroll bars:

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

    This is only for WebKit browsers... Or you could use browser-specific CSS content (if there is any in future). Every browser could have a different and specific property for their respective bars.

    For Microsoft Edge use: -ms-overflow-style: -ms-autohiding-scrollbar; or -ms-overflow-style: none; as per MSDN.

    There is no equivalent for Firefox. Although there is a jQuery plugin to achieve this, http://manos.malihu.gr/tuts/jquery_custom_scrollbar.html

提交回复
热议问题