Make scrollbar visible in mobile browsers

后端 未结 3 736
谎友^
谎友^ 2020-11-28 22:28

when I have a web page with a scrollable content. With css property \"overflow:auto\" or \"overflow:visible\" the scrollbar is visible on desktop browsers, but when I open t

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-28 23:06

      /* !important is needed sometimes */
     ::-webkit-scrollbar {
        width: 12px !important;
     }
    
     /* Track */
    ::-webkit-scrollbar-track {
       -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3) !important;
       -webkit-border-radius: 10px !important;
       border-radius: 10px !important;
     }
    
     /* Handle */
     ::-webkit-scrollbar-thumb {
       -webkit-border-radius: 10px !important;
       border-radius: 10px !important;
       background: #41617D !important; 
       -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5) !important; 
    
     }
     ::-webkit-scrollbar-thumb:window-inactive {
       background: #41617D !important; 
     }
    

    Add this css code - It will change the style of scrollbar in mobile devices only

提交回复
热议问题