Hide scroll bar, but while still being able to scroll

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

    In addition, Scrolling without scroll bar for all browsers.

    CSS

    .keep-scrolling {
      background-color: #eee;
      width: 200px;
      height: 100px;
      border: 1px dotted black;
      overflow-y: scroll; /* Add the ability to scroll y axis*/
    }
    
    /* Hide scrollbar for Chrome, Safari and Opera */
    .keep-scrolling::-webkit-scrollbar {
        display: none;
    }
    
    /* Hide scrollbar for IE, Edge and Firefox */
    .keep-scrolling {
      -ms-overflow-style: none;  /* IE and Edge */
      scrollbar-width: none;  /* Firefox */
    }
    

    SCSS

    .keep-scrolling {
          background-color: #eee;
          width: 200px;
          height: 100px;
          border: 1px dotted black;
          overflow-y: scroll; /* Add the ability to scroll y axis*/
    
         /* Hide scrollbar for IE, Edge and Firefox */
          -ms-overflow-style: none;  /* IE and Edge */
          scrollbar-width: none;  /* Firefox */
    
          /* Hide scrollbar for Chrome, Safari and Opera */
          ::-webkit-scrollbar {
            display: none;
          }
        }
         
    

    HTML

提交回复
热议问题