Hide scroll bar, but while still being able to scroll

前端 未结 30 3288
悲哀的现实
悲哀的现实 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条回答
  •  梦毁少年i
    2020-11-21 04:58

    Another simple working fiddle:

    #maincontainer {
        background: orange;
        width: 200px;
        height: 200px;
        overflow: hidden;
    }
    
    #childcontainer {
        background: yellow;
        position: relative;
        width: 200px;
        height: 200px;
        top: 20px;
        left: 20px;
        overflow: auto;
    }
    

    Overflow hidden on the parent container, and overflow auto on the child container. Simple.

提交回复
热议问题