Home › Developer Tools › CSS Scrollbar Generator

CSS Scrollbar Generator

Design a custom scrollbar visually: pick the width, track and thumb colors, rounded corners, padding and hover color, then scroll the live preview. Copy cross-browser CSS that combines ::-webkit-scrollbar with the standard scrollbar-color and scrollbar-width properties.

Last updated:

Presets

Size & shape

px
px
px
px
px

Colors

Live preview

Scroll or drag the bars
Preview as

Apply to

Generated CSS

        
Advertisement
Advertisement

How to use the CSS Scrollbar Generator

  1. Start from a preset such as Thin, Rounded or Dark, or keep the default.
  2. Set the width and colors of the thumb (the draggable part) and the track (the rail behind it).
  3. Adjust the shape: corner radius, padding around the thumb and the hover color.
  4. Scroll the preview to try it, and choose whether the style applies to the whole page or only to elements with your class.
  5. Copy the CSS and paste it into your stylesheet.

Scrollbar CSS properties explained

Selector / propertyBrowsersWhat it styles
::-webkit-scrollbarChrome, Edge, Safari, OperaThe whole scrollbar: width for vertical bars, height for horizontal ones
::-webkit-scrollbar-trackChrome, Edge, Safari, OperaThe rail the thumb slides in
::-webkit-scrollbar-thumbChrome, Edge, Safari, OperaThe draggable handle; supports :hover and :active
::-webkit-scrollbar-cornerChrome, Edge, Safari, OperaThe square where a vertical and a horizontal scrollbar meet
scrollbar-colorFirefox, Chrome/Edge 121+Two colors: thumb first, then track
scrollbar-widthFirefox, Chrome/Edge 121+auto, thin or none (no pixel values)

Why the Firefox rules are wrapped in @supports

Chromium browsers now support both systems. When an element has scrollbar-color or scrollbar-width set, Chrome and Edge 121+ use those standard properties and ignore every ::-webkit-scrollbar rule, so rounded thumbs, padding and hover colors vanish. @supports not selector(::-webkit-scrollbar) applies the standard properties only in browsers that do not understand the WebKit pseudo-elements, which today means Firefox. If you prefer the simpler standard styling everywhere, untick the option.

Design tips

  • Make the thumb clearly darker (or lighter on dark themes) than the track; a 3:1 contrast keeps it easy to find.
  • A transparent border plus background-clip: padding-box creates a floating pill thumb without shrinking the clickable area of the scrollbar.
  • Style scrollbars of specific panels with a class instead of the whole page if you want the main page to keep the familiar system scrollbar.
  • Hiding scrollbars removes a visual cue that more content exists; if you hide them, add another hint such as a fade at the edge.

Frequently asked questions

How do I change the scrollbar color with CSS?

Use scrollbar-color: thumb-color track-color; this standard property works in Firefox and in Chrome and Edge 121+. For full control of size, rounded corners and hover colors in Chrome, Edge and Safari, also style the ::-webkit-scrollbar, ::-webkit-scrollbar-track and ::-webkit-scrollbar-thumb pseudo-elements. The generator outputs both.

Why are my ::-webkit-scrollbar styles ignored in Chrome?

Since Chrome 121, an element that has scrollbar-color or scrollbar-width set uses the standard properties and ignores ::-webkit-scrollbar. The generated CSS wraps the standard properties in @supports not selector(::-webkit-scrollbar), so Chromium and Safari keep the detailed WebKit styles while Firefox uses the standard ones.

Can I set an exact scrollbar width in Firefox?

No. Firefox only accepts scrollbar-width: auto, thin or none. The generator picks thin when your width is 10px or less and auto otherwise. Rounded corners, padding, gradients and hover colors are WebKit-only, so Firefox shows a simpler version in your chosen colors.

How do I hide the scrollbar but keep scrolling?

Set scrollbar-width: none for Firefox and ::-webkit-scrollbar { display: none; } for Chromium and Safari. The element still scrolls with the mouse wheel, touch and keyboard. Use it sparingly, because a visible scrollbar tells users there is more content.

How do I make space around the scrollbar thumb?

Give the thumb a transparent border and background-clip: padding-box. The border becomes a gap between the thumb and the edge of the track, making the thumb look like a floating pill. The Thumb padding slider controls this.

Do custom scrollbars work on phones?

Mobile browsers on iOS and Android use thin overlay scrollbars that appear only while scrolling, and most ignore custom scrollbar styles. Custom scrollbars matter mainly on desktop.

Are all the tools on FreeToolCabin tested for quality and accuracy?

Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.

Related tools

CSS Border Radius GeneratorRound each corner, draw elliptical 8-value radii or random blob shapes and copy the CSS.CSS Box Shadow GeneratorDesign layered CSS box shadows with a live preview, presets and one-click Copy CSS.CSS Button GeneratorDesign CSS buttons with gradients, borders, shadows and hover and active states, then copy the code.CSS Toggle Switch GeneratorDesign pure-CSS toggle switches: size, colors, shape and animation. Copy accessible HTML + CSS.Open Graph PreviewPaste OG tags and preview how links look on Facebook, X and LinkedIn.YouTube Embed Code GeneratorCreate responsive YouTube embed code with start time, autoplay, loop and privacy mode.CSS Flexbox GeneratorBuild flexbox layouts visually: set container and item properties, then copy the CSS and HTML.Twitter Card GeneratorCreate X / Twitter Card meta tags with Open Graph fallbacks, character counters and a live preview.CSS Grid GeneratorDraw CSS grid layouts: set tracks and gaps, drag to name areas, then copy the CSS and HTML.PX to REM ConverterConvert px to rem or em and back, with a 1-100px table and a whole-CSS converter.Glassmorphism CSS GeneratorDesign frosted-glass UI cards with blur, transparency and border sliders, then copy the CSS.CSS Text Shadow GeneratorLayer CSS text shadows with a live preview and neon, 3D, outline and retro presets.HTML Editor (Live Preview)Write HTML, CSS and JavaScript and see a live, sandboxed preview as you type.HTML to JSX ConverterConvert HTML to valid React JSX: className, htmlFor, style objects, self-closing tags and events.CSS Clip-Path GeneratorDraw CSS clip-path shapes by dragging points: polygons, circle, ellipse and inset. Copy the CSS.CSS Animation GeneratorCreate CSS keyframe animations from 23 presets with live preview, timing controls and Copy CSS.CSS Triangle GeneratorMake CSS triangles in 8 directions with the border trick or clip-path. Set size and color, copy CSS.CSS Loader GeneratorPick from 14 pure CSS spinners and loaders, set color, size and speed, then copy the HTML and CSS.Cubic Bezier GeneratorDrag the control points to design a CSS easing curve, compare it with linear and copy cubic-bezier().CSS Filter GeneratorAdjust blur, brightness, contrast, hue, sepia and drop-shadow on an image and copy the CSS filter.CSS Specificity CalculatorCalculate CSS selector specificity (a, b, c), including :is(), :not(), :has() and :where(), and compare.Google Maps Embed GeneratorTurn an address or coordinates into responsive Google Maps iframe embed code, no API key.Neumorphism CSS GeneratorDesign soft UI neumorphic shapes with live preview and copy the box-shadow CSS.SVG Wave GeneratorMake layered SVG waves for section dividers and export SVG, PNG or a CSS background.SVG Blob GeneratorGenerate random organic SVG blob shapes with gradients and export SVG, PNG or CSS clip-path.CSS Clamp GeneratorTurn min/max sizes and viewport widths into a fluid CSS clamp() value in rem and vw.CSS @font-face GeneratorTurn font files or URLs into ready-to-paste @font-face rules with weights, styles and a preview.CSS Media Query GeneratorBuild @media rules for widths, orientation, dark mode and hover, or get framework breakpoints.CSS Sprite GeneratorPack many icons into one sprite sheet PNG and get CSS classes with background-position.CSS Text Gradient GeneratorMake gradient text with background-clip:text: color stops, angle, font preview and fallback CSS.CSS Tooltip GeneratorBuild pure CSS tooltips: position, arrow, colors, padding and animation. Copy HTML and CSS.HTML Form BuilderDrag and drop form fields with labels and validation, then copy accessible HTML and CSS code.Iframe GeneratorCreate iframe embed code: size or responsive ratio, border, allow, sandbox, lazy load, live preview.PX to VW ConverterConvert pixels to vw and vh for any viewport size, and vw/vh back to px, with breakpoint tables.SVG Path EditorEdit an SVG path d attribute visually: drag points, edit commands, convert, scale and minify.SVG to CSS Data URITurn SVG code into a small URL-encoded data URI for CSS backgrounds, with Base64 size comparison.SVG to JSXTurn SVG code into a clean React component: camelCase attributes, style objects, TypeScript.Tailwind CSS Cheat SheetSearchable Tailwind class to CSS reference with live previews, class decoder and color palette.CSS Hover Effects GeneratorPick button, link and image hover effects, tweak colors and timing, and copy the HTML and CSS.CSS InlinerMove CSS from style blocks into inline style attributes so HTML emails render in every client.CSS Shape Divider GeneratorCreate wave, tilt, curve and triangle section dividers and copy the SVG, HTML and CSS.CSS Transform GeneratorRotate, scale, skew and translate an element with sliders and copy the CSS transform code.Font Pairing ToolPreview Google Font heading and body pairs on real layouts and copy the embed code and CSS.HTML Accessibility CheckerPaste HTML to find WCAG accessibility problems with impact level, the failing element and a fix.HTML Image Map GeneratorDraw clickable rectangle, circle and polygon hotspots on an image and get image map HTML.SVG ViewerOpen or paste SVG code to preview it live with zoom, backgrounds, size info and PNG export.Pathfinding VisualizerAnimate BFS, DFS, Dijkstra, A* and greedy search on a grid with walls, weights and mazes.Web App Manifest GeneratorCreate a PWA manifest.json and every app icon size from one image, downloaded as a ZIP.CSS Background Pattern GeneratorMake pure-CSS stripes, dots, checkerboard, zigzag and grid backgrounds and copy the code.CSS Color Filter GeneratorTurn a HEX color into a CSS filter that recolors black icons and SVGs, with an accuracy score.CSS Gradient Animation GeneratorCreate animated gradient backgrounds: pick colors, angle and speed, preview live and copy the CSS.
See all 52 Web, HTML & CSS Tools →