Overview
Fixed-background parallax is the oldest depth illusion on the web: pin one layer in place with background-attachment: fixed (or by ducking the layer outside the scrolling element entirely), and let the foreground scroll over it. The disparity between “moving” and “staying” reads as depth without any 3D math. This pattern reimplements the effect without browser background-attachment quirks by anchoring an SVG hero layer at z-index: 0 and translating a duplicated card stack on top via translateY.
When to use it
Reach for fixed-background parallax when you have a strong static composition (illustration, photo, gradient artwork) that you want to anchor while content scrolls past it — landing pages, story sections, editorial headers. Skip it for dashboards or any layout where each fold owns its own header; the parallax becomes noise when there is nothing to be parallaxing past. Skip it on mobile Safari too unless you have tested the specific iOS version — background-attachment has been quietly broken there for years.
How it works
The pattern uses a duplicated card stack: the same N cards repeat twice inside a single .parallax-stack element. The stack animates from translateY(0) to translateY(-50%) on an infinite loop. Because the bottom half of the stack is an exact copy of the top half, the moment the animation reaches -50% the view is identical to 0% — the loop seam is invisible. The hero scene sits at z-index: 0 inside the parallax frame and never moves, so the depth illusion comes entirely from the foreground stack’s translation against a static backdrop.
Production gotchas
On mobile Safari, background-attachment: fixed simply does not work — the background scrolls with the foreground anyway. The duplicated-stack approach in this pattern sidesteps the property entirely, which is why it ships as the baseline. translateY(-50%) only lands on a clean seam if the stack height is an exact multiple of one card’s height — if you change card sizes mid-list, the loop will visibly jump every cycle. Browsers throttle non-RAF-driven scroll animations when the tab is backgrounded; this is fine here because the stack uses a CSS keyframe (browser-native), not a JS scroll handler.
Accessibility
Parallax motion is one of the most common vestibular triggers, so the prefers-reduced-motion: reduce branch in this pattern pins the stack at translateY(-50%) so a representative middle slice is visible without movement. The hero scene is decorative (aria-hidden="true"); the real content for screen readers lives in the cards above it.
References
Implementation depth
Treat fixed-background parallax as a depth illusion with browser caveats, especially on mobile Safari. A duplicated foreground stack is often more reliable than depending on background-attachment: fixed across every viewport and input mode.
The important production check is the loop boundary. If the duplicated stack height does not divide cleanly, the foreground jumps even though the background is static. Under reduced motion, pin the stack at a representative state instead of removing the scene entirely.