CSS Scrollbar Generator
Style custom scrollbars with CSS — width, track/thumb colors, and radius, with a live scrollable preview and cross-browser (WebKit + Firefox) code. Free.
💡 How to use
- Style the scrollbar and scroll the preview panel to test it.
- The output includes both the WebKit (
::-webkit-scrollbar) and standard (scrollbar-color) syntax. - Apply the rules to a scrollable element, or to
htmlfor the whole page.
Free CSS Scrollbar Generator
Style custom scrollbars with CSS and copy the code in one click. Set the width, track and thumb colors, hover color, and corner radius, then scroll a live preview to test it — and get both the WebKit and standard cross-browser syntax. Free, no sign-up, runs in your browser.
Can you style scrollbars with CSS?
Yes. Modern browsers let you customise the scrollbar's size and colors so it matches your design instead of using the default gray. There are two syntaxes: the older WebKit pseudo-elements (::-webkit-scrollbar and friends) supported by Chrome, Edge, and Safari, and the newer standard properties scrollbar-width and scrollbar-color supported by Firefox and increasingly everywhere. This generator produces both so your styled scrollbar works across browsers.
How to use the scrollbar generator
It is instant:
- Set the scrollbar width and the track, thumb, and hover colors.
- Adjust the corner radius of the thumb and track.
- Scroll the live preview to see the result.
- Copy the CSS and apply it to a scrollable element or the whole page.
The two scrollbar syntaxes explained
Each browser family reads a different set of rules:
- ::-webkit-scrollbar sets the width/height of the bar.
- ::-webkit-scrollbar-track styles the groove the thumb slides in.
- ::-webkit-scrollbar-thumb styles the draggable handle, with a :hover state.
- scrollbar-width (thin/auto) and scrollbar-color (thumb track) cover Firefox and the standard.
Where to apply the styles
Attach the rules to whichever element scrolls. For a single scrollable panel — a sidebar, a code block, a chat window — give it a class and apply the rules to that class, as this tool does with .scroll-area. To restyle the main page scrollbar, apply the rules to the html element instead. Remember the element also needs overflow set (for example overflow-y: auto) for a scrollbar to appear in the first place.
Keep custom scrollbars usable
A styled scrollbar should still be easy to see and grab. Keep enough contrast between the thumb and the track so users can tell where the handle is, and do not make the bar so thin that it is hard to click — a hover color that darkens the thumb helps signal interactivity. On touch devices scrollbars are often hidden anyway, so never rely on a visible scrollbar as the only cue that content scrolls.
Pro tip
Match the thumb color to your brand accent and the track to a subtle tint of your background for a cohesive look, and keep the same scrollbar style across all scrollable areas for consistency. If you support dark mode, define separate thumb and track colors for each theme. Pair this with our CSS Color Converter to fine-tune the shades.
FAQ
Is this CSS Scrollbar Generator free?
How do I style a scrollbar in CSS?
Does custom scrollbar styling work in Firefox?
How do I style only one scrollable element?
Why isn't my scrollbar showing up?
Can I make the scrollbar thinner?
Do custom scrollbars work on mobile?
Related tools
Pro tip: pair this tool with CSS Box-Shadow Generator and CSS Gradient Generator for a faster SEO workflow.