How to Style Scrollbars in CSS

You can style different parts of a scrollbar in webkit browser, using the below selectors:

// Change style of scrollbars with the// ::-webkit-scrollbar pseudo elements

::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background:  #282e3b;
}

::-webkit-scrollbar-thumb {
    background:  #fff;
}
scrollbar.css
Copied to clipboard!

Keep in mind that support for scrollbar is really low when using it unprefixed. This is because the specification is still in working draft.

How to Style Scrollbars in CSS
If you would like to see more Webtips, follow @flowforfrank

Resources:

Remove ads
Remove ads

๐Ÿ“š Get access to exclusive content

Want to get access to exclusive content? Support webtips with the price of a coffee to get access to tips, checklists, cheatsheets, and much more. โ˜•

Get access Support us
Remove ads Read more on
Remove ads
Remove ads
๐ŸŽ‰ Thank you for subscribing to our newsletter. x This site uses cookies We use cookies to understand visitors and create a better experience for you. By clicking on "Accept", you accept its use. To find out more, please see our privacy policy.