Hide scroll bar, but while still being able to scroll

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

    The following SASS styling should make your scrollbar transparent on most browsers (Firefox is not supported):

    .hide-scrollbar {
      scrollbar-width: thin;
      scrollbar-color: transparent transparent;
    
      &::-webkit-scrollbar {
        width: 1px;
      }
    
      &::-webkit-scrollbar-track {
        background: transparent;
      }
    
      &::-webkit-scrollbar-thumb {
        background-color: transparent;
      }
    }
    

提交回复
热议问题