Parallax Scrolling Websites: Design Inspiration
- Relative layer position
- %
- Result
- Scroll depth (px)
- 3000 px
- You entered
- Layer speed ratio
- 0.5
- You entered
Parallax scrolling websites create a 3D depth effect where background layers move slower than foreground content as the user scrolls. This guide shows you how the technique works, where it shines, and how to use it without hurting usability or performance. You’ll find concrete examples, common pitfalls, and practical tips for your next design project.
Formula
The core of parallax is the difference in scroll speed between layers. If the foreground moves at the normal scroll speed and a background layer moves at a fraction s of that speed, the background appears to shift by d = t × (1 − s), where t is the total scroll distance. The relative position r = (1 − s) × 100% tells you how much slower the background is compared to the foreground.
Worked Example
With a scroll depth of 3000 px and a layer speed ratio of 0.5 (background moves half as fast), the apparent depth shift is 3000 × (1 − 0.5) = 1500 px. The relative layer position is (1 − 0.5) × 100 = 50%, meaning the background moves at 50% of the foreground speed.
What Is Parallax Scrolling?
Parallax scrolling is a web design technique where different elements on a page move at different speeds as the user scrolls. The name comes from the parallax effect in astronomy, where objects at different distances appear to move at different rates when the observer moves. On the web, this is usually achieved with CSS background-attachment: fixed, JavaScript libraries, or CSS transforms triggered by scroll events.
The effect gained popularity in the early 2010s with sites like Nike Better World and Spotify’s annual reports, but it has roots in 2D video games like Sonic the Hedgehog and Super Mario, which used layered backgrounds to create depth on a flat screen. Today, parallax is used in product launches, storytelling sites, and portfolios to guide the eye and add polish.
How Parallax Works: The Technical Side
There are three main ways to implement parallax on a website:
- CSS
background-attachment: fixed– The simplest method. The background stays fixed while the content scrolls over it. Works well for single images but can cause performance issues on mobile. - JavaScript scroll listeners – You listen to the scroll event and translate elements at different speeds using
transform: translateY(). This gives fine control but requires throttling to avoid jank. - CSS scroll-driven animations – Modern browsers support
animation-timeline: scroll(), which lets you animate elements based on scroll position without JavaScript. This is the most performant option for simple effects.
The key to smooth parallax is using transform and opacity instead of changing top or margin, because transforms are GPU-accelerated. Also, avoid triggering layout thrash by reading scroll position once per frame and batching style changes.
When to Use Parallax (and When to Avoid It)
Parallax works best when it enhances the story or the product, not when it’s just decoration. Use it for:
- Product showcases – Let the background shift as you scroll through features, like Apple does for its product pages.
- Narrative storytelling – Non-profits and journalism sites use parallax to take readers through a timeline or journey.
- Portfolio sites – A subtle depth effect can make a designer’s work feel more dynamic.
- Landing pages – A single hero section with a fixed background can add polish without overwhelming the user.
Avoid parallax when the page is text-heavy (like a blog or documentation), when the audience is on low-end mobile devices, or when the content must be accessible to users with motion sensitivity. The prefers-reduced-motion CSS media query lets you disable or tone down the effect for those users.
Common Mistakes and How to Fix Them
Even well-intentioned parallax can go wrong. Here are the most frequent issues and their solutions:
- Performance lag – Too many moving layers or using
background-attachment: fixedon mobile causes stutter. Fix: use transform-based animations and limit the number of layers. - Broken on mobile – Many mobile browsers don’t support
background-attachment: fixed. Fix: use a fallback that disables parallax on small screens. - Content unreadable – Text overlapping a moving background can be hard to read. Fix: add a semi-transparent overlay or blur the background behind text.
- Scroll hijacking – Some sites animate the scroll itself, which disorients users. Fix: never control the scroll position; only animate elements based on scroll.
- Accessibility issues – Users with vestibular disorders may feel dizzy. Fix: respect
prefers-reduced-motionand provide a static fallback.
Real-World Examples to Inspire You
While specific sites change over time, these types of parallax implementations are worth studying:
- Product storytelling – A tech company’s product page where the phone rotates as you scroll, with the background shifting from dark to light.
- Interactive infographics – A climate change site where a glacier melts as you scroll, with the foreground and background moving at different speeds.
- Portfolio depth – A photographer’s site where each project is a full-screen image that moves slightly slower than the text below it.
- Gaming-style sites – A game launch page that mimics side-scrolling levels with layered backgrounds.
When looking for inspiration, search for “parallax scrolling examples” on design galleries like Awwwards or CSS Design Awards. Note how the best sites use parallax sparingly—often only in the hero or between key sections—rather than on every element.
Alternatives to Parallax
If parallax feels too heavy or risky, consider these alternatives that still add depth:
- Scroll-triggered fade-ins – Elements fade and slide into place as they enter the viewport. Lightweight and widely supported.
- Fixed backgrounds – A single fixed background without multiple layers. Simpler and more performant.
- 3D CSS transforms – Use
perspectiveandrotateX()to create a subtle tilt effect as the user scrolls. - Video backgrounds – A looping video can add motion without the complexity of layered scrolling.
Frequently Asked Questions
Does parallax hurt SEO?
No, not directly. Search engines crawl the HTML content, and parallax is usually implemented with CSS or JavaScript that doesn’t hide content. However, if you use JavaScript to load content dynamically, ensure it’s still in the initial HTML response or properly rendered. The bigger risk is user experience—if the effect causes slow loading or high bounce rates, that can indirectly hurt rankings.
How do I make parallax accessible?
Use the prefers-reduced-motion media query to disable or simplify the effect for users who request reduced motion. Also, ensure that all content is readable without the effect, and don’t rely on parallax to convey essential information. Provide a static fallback for older browsers.
What’s the best way to implement parallax in 2025?
For simple effects, use CSS scroll-driven animations (animation-timeline: scroll()) because they run on the compositor and don’t require JavaScript. For complex multi-layer effects, a library like GSAP’s ScrollTrigger is popular, but you can also write vanilla JavaScript with requestAnimationFrame for better control.
How many layers should I use?
Keep it to two or three layers. Each additional layer adds complexity and performance cost. A common setup is a background image, a mid-ground element, and the foreground content. More layers rarely improve the visual impact enough to justify the added weight.
Can I use parallax on a WordPress site?
Yes, many WordPress page builders (like Elementor or Divi) have built-in parallax options. You can also add a plugin or use a lightweight script. Just be mindful of performance—test on mobile and use caching to keep load times low.
Does parallax work on mobile?
It can, but it’s tricky. Mobile browsers often lack support for background-attachment: fixed, and touch scrolling can make effects feel laggy. A common approach is to disable parallax on screens below a certain width and use a static background instead. Always test on real devices.
Related
Formula used
in t | Scroll depth (px) | px | 3000 | 0 in s | Layer speed ratio | - | 0.5 | 0 out d | Apparent depth shift | px | t * (1 - s) | 0 out r | Relative layer position | % | (1 - s) * 100 | 0
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.