CSS Mask Parallax Demo - Online Scroll Reveal Effect
Use CSS masks and fixed backgrounds to create a unique parallax reveal effect. Copy the code. No JavaScript.
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.
Use CSS masks and fixed backgrounds to create a unique parallax reveal effect. Copy the code. No JavaScript.
Create an animation that advances with scroll using animation‑timeline: scroll(). See the visual timeline editor. Modern CSS.
Test overscroll‑behavior: contain to prevent background scroll or pull‑to‑refresh. See the effect in a live demo.
Toggle scrollbar‑gutter: stable to reserve space for the scrollbar and avoid content jumps. Visual demo with two columns.
Paste your full CSS and HTML; automatically identify and extract the styles needed for the visible part. Reduce render‑blocking resources.
Create a customizable scrolling marquee banner. Copy the HTML and CSS. For retro web projects or fun.
Use named grid lines instead of column numbers. See how they simplify placement. Visual, interactive learning.
Create outlined text with the text‑stroke property. Adjust width and color. Preview and copy the CSS.
Build a complete font‑stack for your website. Choose a primary font and get the best fallback options for different OS. Copy the CSS.
Style the first letter of a paragraph as a large decorative drop cap. Choose font, color, and size. Get the CSS & HTML.
Compare all CSS easing presets side by side on a bouncing ball. See which curve fits your UI animation.
See how grid-auto-flow: row vs column changes item placement. Add and remove items to understand the algorithm. Visual.
New CSS text‑spacing property for fine control over punctuation spacing. See the effect live. For advanced typography.
Compare break‑all, keep‑all, and overflow‑wrap: anywhere/break‑word. Paste long words and see how they wrap.
Create vertically oriented text layouts with `writing‑mode`. See the effect and copy the complete CSS. For vertical languages.
Style a drop cap using the initial‑letter property. Set size and sink. Modern alternative to pseudo‑element hacks.
Style a drop cap using the initial‑letter property. Set size and sink. Modern alternative to pseudo‑element hacks.
Create a pure CSS countdown timer with a flipping number effect. Adjust duration and style. No JavaScript needed for display.
Style underlines, overlines, and strike-throughs with colors, wavy styles, and thickness. Modern CSS text‑decoration.
Animate elements as they enter and exit the viewport using view() timeline. Parallax and reveal effects without JS.
Resize the container and see the difference between repeat(auto‑fill, …) and auto‑fit. Understand responsive grid behavior.
Paste your CSS and sort the properties of each rule alphabetically or by concentric groups. Keep your stylesheets consistent without a build step.
Toggle between light and dark mode for a demo page. See how to use the media query. Copy the pattern.
Create seamless CSS background patterns like stripes, polka dots, checkerboard. Adjust size and colors. Copy the tiny CSS.
Apply the drop‑shadow() filter and compare it with box‑shadow. See how it follows the contour of transparent images. Copy code.
See the difference between clone and slice on inline boxes that break across lines. Useful for multi‑line headings.
Create glowing, neon‑style text effects with multiple text‑shadows. Adjust colors and intensity. Copy the CSS.
Visually create the glassmorphism effect: background blur, transparency, and border. Copy the complete CSS. Modern UI design.
Visually name grid areas in a table and generate grid‑template‑areas CSS. Perfect for complex layouts. Drag‑free.
Paste your CSS and strip all `!important` declarations in one click. See a list of affected rules. Local tool.