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 →CSS Box Shadow: A Complete Guide with Examples (2026)
Master CSS box-shadow: every value explained, layering multiple shadows for realistic depth, inset shadows, the spread trick, and copy-paste examples for cards, buttons, and more.
CSS Animations: A Practical Guide to Keyframes and Transitions (2026)
Learn the difference between transitions and keyframe animations, how to write @keyframes, the properties worth animating for 60fps, and easing that actually looks good.
CSS clamp() and Fluid Typography: Stop Writing Font-Size Media Queries (2026)
Learn how CSS clamp() creates type that scales smoothly between screen sizes with a single line, the formula behind it, and how to build a fully fluid type scale without media queries.