Change size of scrollbar thumb with CSS

后端 未结 8 501
旧巷少年郎
旧巷少年郎 2020-12-30 03:21

I want to get a scrollbar with a thumb larger than the track. I can change the color, the opacity, everything, but I don\'t know how to change the size of the thumbs and the

8条回答
  •  伪装坚强ぢ
    2020-12-30 03:58

    You can setup your size using width in ::-webkit-scrollbar.

    I don't think it is possible to set separately the thumb and track size.

    http://jsfiddle.net/rvcfmun7/

    .test {
        overflow: auto;
        background gray ;
        max-height: 500px;
        width: 400px;
    }
    
    .test::-webkit-scrollbar{
        width: 20px;
    }
    
    .test::-webkit-scrollbar-track{
        background: rgb(41,41,41);
    }
    ::-webkit-scrollbar-thumb{
        width: 15px;
        background: rgb(111,111,111);
    }
    

提交回复
热议问题