Custom Scrollbar CSS Generator - Online Firefox & Webkit
Design a fully styled scrollbar with colors, width, radius, and hover effects. Supports both ::-webkit‑scrollbar and Firefox scrollbar‑width.
UD5 Toolkit
Instantly compare smooth vs auto scrolling side‑by‑side. Click any section button below to see the difference.
/* Enable smooth scrolling for the entire page */
html {
scroll-behavior: smooth;
/* Optional: offset for fixed headers */
scroll-padding-top: 80px;
}
/* Respect user motion preferences */
@media (prefers-reduced-motion: reduce) {
html {
scroll-behavior: auto;
}
}
/* Smooth scrolling inside a specific element */
.custom-scroll-box {
overflow-y: auto;
scroll-behavior: smooth;
scroll-padding-top: 16px;
}
/* Target elements can use scroll-margin */
.custom-scroll-box .section {
scroll-margin-top: 16px;
}
Everything you need to know about CSS scroll-behavior
scroll-behavior is a CSS property that controls how scrolling behaves when triggered by navigation (anchor links, scrollTo(), etc.). It accepts two values: smooth (animated gliding) and auto (instant jump). It's part of the CSSOM View Module and is widely supported across modern browsers.
Add html { scroll-behavior: smooth; } to your global stylesheet. This single line enables smooth scrolling for all anchor link navigation across your site. For fixed headers, also set scroll-padding-top to the header height so targets aren't hidden behind it.
Chrome 61+ (Sep 2017), Firefox 36+ (Feb 2015), Edge 79+ (Jan 2020), Safari 15.4+ (Mar 2022), and Opera 48+. Internet Explorer does not support it. Global coverage is approximately 96%+ as of 2025. For unsupported browsers, it gracefully falls back to auto behavior.
scroll-behavior: smooth is a declarative CSS solution — it applies to all scroll actions within the element automatically. element.scrollIntoView({ behavior: 'smooth' }) is an imperative JavaScript method for one-off scrolls. CSS is simpler and doesn't require scripting; JS gives you more granular control (e.g., scroll to a specific offset, chain animations). You can use both together.
No. The smooth value uses the browser's built-in easing curve, which cannot be customized via CSS. If you need custom speed or easing functions, use JavaScript libraries like Lenis, GSAP ScrollToPlugin, or implement your own requestAnimationFrame loop. The CSS property is designed for simplicity, not fine-tuned control.
It can. Some users with vestibular disorders may find smooth scrolling disorienting. Always wrap your smooth-scroll CSS in a @media (prefers-reduced-motion: reduce) query that sets scroll-behavior: auto. This respects the user's system-level accessibility preference. Also, smooth scrolling adds a slight delay before the target is reached, which may impact users relying on instant navigation.
scroll-padding is a CSS shorthand that defines an offset inside the scroll container. When smooth-scrolling to a target, the container stops early by the padding amount, preventing the target from touching the edge. It's especially useful with fixed headers: html { scroll-padding-top: 80px; } ensures anchor targets land 80px below the top of the viewport, clear of a sticky nav bar.
scroll-margin is applied to the target elements themselves, while scroll-padding is applied to the scroll container. Use scroll-margin-top on individual sections if you want different offsets per target. Use scroll-padding-top on the container for a uniform offset. Both achieve similar visual results but from different sides of the scroll boundary.
Yes! scroll-behavior works for both vertical and horizontal scrolling. If your container has overflow-x: auto and you navigate horizontally (e.g., via scrollTo({ left: ... })), the smooth or auto behavior applies equally. It's direction-agnostic.
No. scroll-behavior is not an animatable property — it's a discrete property. You cannot transition between smooth and auto. The property determines how the scroll action is performed, not a visual style that can be interpolated. It takes effect immediately when changed.
Design a fully styled scrollbar with colors, width, radius, and hover effects. Supports both ::-webkit‑scrollbar and Firefox scrollbar‑width.
Construct a CSS‑only carousel with scroll‑snap and scroll‑driven animations. Configurable gap, items, and progress indicator. Copy the HTML/CSS.
Design a layout where nested grids share track sizes with their parent via subgrid. Copy the complete CSS.
Create a pure CSS scroll progress indicator using animation‑timeline: scroll(). No JavaScript. Copy the complete code.
Paste your CSS and see warnings for properties that have limited browser support. Links to CanIUse. Modernize safely.
Query the permission state of camera, microphone, geolocation, and more. See the response and learn the API.
Limit browser gestures on an element: pan‑x, pinch‑zoom, manipulation. Draw on a canvas to test. Mobile dev helper.
Acquire and release locks across tabs. Prevent race conditions in IndexedDB or localStorage. Visual queue and lock state.
Test the Fullscreen API: request fullscreen on a colored div, detect changes, and copy the JavaScript boilerplate.
Create complex linear gradients with any number of color stops, exact angles, and length units. Live preview and CSS code.
Style underlines, overlines, and strike-throughs with colors, wavy styles, and thickness. Modern CSS text‑decoration.
Design a button or card that glows on hover. Adjust shadow color, spread, and transition. Copy the CSS. Rich UI.
Create a realistic letterpress (debossed) text effect using CSS text‑shadow and background. Adjust depth and light direction. Copy code.
Generate a subtle noise/grain texture as a CSS background pattern. Adjust opacity and size. For that film look.
Create a customizable checkerboard or grid background using pure CSS gradients. Adjust cell size and colors. Copy the code.
Upload two images and apply CSS blend modes (multiply, screen, overlay, etc.). See the result and copy the filter CSS. Pure frontend.
Add print styles like removing backgrounds, adding page breaks, setting margins. See print preview instantly.
Create a pure CSS countdown timer with a flipping number effect. Adjust duration and style. No JavaScript needed for display.
Create a glowing or rotating border animation around an element. Copy the CSS keyframes. Pure CSS magic.
Create a custom HTML/CSS progress bar with percentage, colors, and animation. Copy the code. Modern UI element.
Design a realistic neon sign text with multiple layers of glow. Copy the CSS and HTML. Perfect for headers.
A replica of the famous Flexbox Froggy game: solve alignment puzzles by writing CSS. Progress saved locally. Fun frontend learning.
Fetch a website's CSS and extract :root custom properties (‑‑color) to reveal its design token palette. For learning and inspiration.
Find safe mixing ratios for the classic elephant toothpaste demonstration. Volume adjustments for different container sizes.
Recreate the target CSS linear gradient by adjusting stops and colors. A unique game for front‑end developers to master gradients.
Browse and search all Font Awesome 6 icons with preview, class name, and unicode. Copy the HTML snippet. Perfect for web developers.
Create text with a gradient fill using CSS background-clip. Configure colors and direction. Copy the code. Works in modern browsers.
A complete, searchable list of all 140+ named HTML/CSS colors with their hex codes and color previews. Click to copy code. Essential web reference.
Visually experiment with Flexbox container and item properties. See the layout update in real time and copy the CSS. Learn by doing, fully interactive.
Minify JavaScript and CSS code to reduce file size for production. Remove whitespace and comments instantly. Run locally, your code stays private.