Hide scroll bar, but while still being able to scroll

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

    This works for me with simple CSS properties:

    .container {
        -ms-overflow-style: none;  /* Internet Explorer 10+ */
        scrollbar-width: none;  /* Firefox */
    }
    .container::-webkit-scrollbar { 
        display: none;  /* Safari and Chrome */
    }
    

    For older versions of Firefox, use: overflow: -moz-scrollbars-none;

提交回复
热议问题