Make scrollbar visible in mobile browsers

后端 未结 3 728
谎友^
谎友^ 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:05

    Try adding the below to your CSS, note that this is webkit specific:

    Demo Fiddle

    ::-webkit-scrollbar {
        -webkit-appearance: none;
    }
    
    ::-webkit-scrollbar:vertical {
        width: 12px;
    }
    
    ::-webkit-scrollbar:horizontal {
        height: 12px;
    }
    
    ::-webkit-scrollbar-thumb {
        background-color: rgba(0, 0, 0, .5);
        border-radius: 10px;
        border: 2px solid #ffffff;
    }
    
    ::-webkit-scrollbar-track {
        border-radius: 10px;  
        background-color: #ffffff; 
    }
    

提交回复
热议问题