Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Webkit Scrollbar Width Change

I am trying to change the width of the scrollbar through -webkit-scrollbar property but Chrome rejects it saying that it is an unknown property. Any idea why ?

like image 229
Anum Malik Avatar asked Sep 03 '26 15:09

Anum Malik


2 Answers

Works well in Chrome — http://jsfiddle.net/sergdenisov/wqr5zxpk/2/:

div {
    height: 200px;
    background: #f7f6f5;
    overflow-x: hidden;
    overflow-y: auto;
}

    div::-webkit-scrollbar {
        background: #fff;
        width: 15px;
        height: 15px; 
    }

    div::-webkit-scrollbar-thumb {
        background: #c5c5c5;
    }
like image 70
sergdenisov Avatar answered Sep 05 '26 04:09

sergdenisov


.class::-webkit-scrollbar{ width :6px; } The above worked for me. I wanted to apply the width only when the class "class" was added to an element.

like image 31
Anum Malik Avatar answered Sep 05 '26 06:09

Anum Malik



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!