What is the CSS Scrollbar Generator?
Style custom scrollbars with CSS. Set track colour, thumb colour, width, and border-radius. Works in Chromium-based browsers.
Everything runs locally in your browser. Adjust the controls above, preview instantly, and copy clean, production-ready CSS — no account, no upload.
Using the CSS Scrollbar Generator
Everything lives in the panel at the top of this page. There is nothing to install — it all runs right here in your browser.
Set scrollbar width
The -webkit-scrollbar width controls the scrollbar track width in Chromium browsers. Firefox uses thin (6px), auto (default), or none.
Choose track and thumb colours
Track is the channel background; thumb is the draggable handle. Set both colours and the thumb hover colour.
Set border-radius
Rounded thumbs (border-radius: 4px) are the current UI convention for custom scrollbars.
Copy the CSS
Apply the class to any scrollable container. Both -webkit and Firefox syntax are included.
What the generated code looks like
Clean, production-ready CSS — no vendor bloat, no unnecessary declarations.
/* Chromium-based browsers */
.custom-scroll::-webkit-scrollbar {
width: 8px;
}
.custom-scroll::-webkit-scrollbar-track {
background: #f1f1f1;
border-radius: 4px;
}
.custom-scroll::-webkit-scrollbar-thumb {
background: #c1c1c1;
border-radius: 4px;
}
.custom-scroll::-webkit-scrollbar-thumb:hover {
background: #a1a1a1;
}
/* Firefox */
.custom-scroll {
scrollbar-width: thin;
scrollbar-color: #c1c1c1 #f1f1f1;
}Firefox does not support -webkit-scrollbar pseudo-elements. The scrollbar-width and scrollbar-color properties are the Firefox equivalent. Chrome 121+ also supports the standard properties.
Common mistakes & how to fix them
A few habits trip people up. Here is what to watch for — and the exact fix.
Applying scrollbar styles to body and expecting them everywhere
::-webkit-scrollbar on body only styles the page scrollbar, not overflow scrollable elements.
Fix: Apply the scrollbar class to each scrollable element, or use :root ::-webkit-scrollbar for a global default.
Pro tips for better results
Set scrollbar-gutter: stable to prevent layout shift
When content height changes and a scrollbar appears/disappears, the page width shifts. Add scrollbar-gutter: stable to the scrollable container to reserve space for the scrollbar permanently.
Frequently asked questions
From the blog
Read more →Modern CSS techniques every developer should know
A practical tour of the CSS features that replaced yesterday’s hacks.
From design to code without the friction
How visual generators speed up the build without sacrificing clean output.
Writing CSS that scales with your project
Tokens, naming, and structure that keep large stylesheets maintainable.