UTILS.
Private by default
▌

CSS Scrollbar Styler

Style a custom scrollbar and copy the ::-webkit-scrollbar CSS.

Your files stay on this device

Files are processed in your browser, never uploaded. The site downloads code and assets to run the tools. No accounts or trackers.

Use Download to save this tool as one HTML file for offline use.

Privacy →

About this tool

CSS Scrollbar Designer builds the CSS for a custom scrollbar and previews it on a scrollable box of 14 lines of sample text. Four controls shape the result: width from 2 to 30 pixels, thumb corner radius from 0 to 20 pixels, a track colour and a thumb colour, both chosen with colour pickers. The CSS updates as you move each control.

The copied code has two parts. First come ::-webkit-scrollbar, ::-webkit-scrollbar-track and ::-webkit-scrollbar-thumb rules that set the size, the colours and the rounding; the width value is used for both width and height, so vertical and horizontal bars match. After them, a scrollbar-width: thin and scrollbar-color declaration with the same two colours is added inside an @supports not selector(::-webkit-scrollbar) block, so only browsers without the WebKit pseudo-elements, such as Firefox, use it. The selector in the copied code is .scrollbox, so add that class to your scrollable element or replace the selector with your own, such as a container that has overflow: auto.

Two limits are worth knowing. The standard properties cannot set a pixel width or a radius, so a browser without the WebKit rules, such as Firefox, shows a thin bar in your colours rather than your exact width and rounding. There is also no separate hover or pressed colour for the thumb. Many touch devices draw overlay scrollbars that ignore this styling altogether.

Frequently asked questions

Which browsers support this styling?
The ::-webkit-scrollbar rules were made for Chrome, Edge and Safari, and the scrollbar-width and scrollbar-color lines are there for Firefox. Firefox uses the standard properties, which gives your colours but not your custom width or radius.
How do I apply it to my own element?
Copy the CSS and give your scrollable element the class scrollbox, or replace that selector with your own.
Why does my scrollbar look different from the preview?
Browsers draw scrollbars differently, and the standard scrollbar-width and scrollbar-color properties offer less control than the WebKit rules. Overlay scrollbars on phones and some operating system settings can also hide custom styling.
Can I style the hover state or the arrow buttons?
Not here. The tool writes a track and a thumb only. You can add ::-webkit-scrollbar-thumb:hover or button rules by hand in the copied CSS.

More tools