Hide scroll bar, but while still being able to scroll

前端 未结 30 3403
悲哀的现实
悲哀的现实 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:50

    HTML:

    CSS:

    .parent{
        position: relative;
        width: 300px;
        height: 150px;
        border: 1px solid black;
        overflow: hidden;
    }
    
    .child {
        height: 150px;   
        width: 318px;
        overflow-y: scroll;
    }
    

    Apply CSS accordingly.

    Check it here (tested in Internet Explorer and Firefox).

提交回复
热议问题