Hide scroll bar, but while still being able to scroll

前端 未结 30 3393
悲哀的现实
悲哀的现实 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 05:06

    I just wanted to share a combined snippet for hiding the scrollbar that I use when developing. It is a collection of several snippets found on the Internet that works for me:

    .container {
        overflow-x: scroll; /* For horiz. scroll, otherwise overflow-y: scroll; */
    
        -ms-overflow-style: none;
        overflow: -moz-scrollbars-none;
        scrollbar-width: none;
    }
    
    
    .container::-webkit-scrollbar {
        display: none;  /* Safari and Chrome */
    }
    

提交回复
热议问题