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 ?
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;
}
.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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With