Market
Pricing
Sign inStart
Field GuideMotion
Motion

Parallax effect: depth in scrolling and motion design

Parallax borrows a trick from your own eyes: near things move faster than far ones. Used lightly it adds depth to a page or a loop; overdone it makes people feel seasick. Here is how to do it well.

GradientlyVerified Gradiently account·October 1, 2026·5 min read
Cover: Peony Aurora · GR·7JJF·RQ

The short version

  • A parallax effect creates depth by moving layers at different speeds, with nearer layers moving faster than distant ones.
  • On websites, parallax scrolling can now be built in CSS with scroll-driven animations, without JavaScript, in browsers that support them.
  • The older background-attachment: fixed technique is ignored by iOS Safari, so it should not be relied on for mobile.
  • Large or fast parallax movement can cause discomfort for people with vestibular disorders, so it should be turned off when a visitor prefers reduced motion.
  • Subtle parallax, with layers moving only a little, adds depth without distracting from the content.
On this page
How parallax creates depthParallax effect in CSS with scroll-driven animationsOther ways to build parallax scrollingParallax and reduced motionParallax in motion design and videoDesigning a parallax hero, step by step

A parallax effect makes a flat design feel deep by moving its layers at different speeds: the background drifts slowly, the middle a little faster, and the foreground fastest, just as distant hills seem to crawl past a train window while the fence posts race by. On websites it usually happens as you scroll. In motion design it happens over time, in a loop or a video. Either way, the best parallax is small, slow and switched off for anyone who has asked their device for less motion.

How parallax creates depth

Your brain judges distance partly from relative movement. When two layers move at the same speed they read as one flat surface. When one moves more slowly, it reads as further away. Three layers are usually enough to create convincing depth.

Background

Speed relative to scroll

Slowest, roughly 10% to 30% of the scroll

What goes on it

A gradient, sky, texture or soft colour field
MiddleMedium, around half

What goes on it

Shapes, photos, illustrations
Foreground

Speed relative to scroll

Normal scroll speed

What goes on it

Headlines, buttons, the actual content
LayerSpeed relative to scrollWhat goes on it
BackgroundSlowest, roughly 10% to 30% of the scrollA gradient, sky, texture or soft colour field
MiddleMedium, around halfShapes, photos, illustrations
ForegroundNormal scroll speedHeadlines, buttons, the actual content
A simple three layer parallax. Keep the content on the layer that scrolls normally, so reading is never affected.

Text stays put

Never put body text or buttons on a moving parallax layer. Words that slide at a different speed from the page are tiring to read and hard to click.

Parallax effect in CSS with scroll-driven animations

Modern CSS can tie an animation to scroll position instead of time, using animation-timeline. The browser runs it off the main thread, so it stays smooth, and no JavaScript is needed. Support is still growing: it works in Chromium browsers and recent Safari, so check browser support on MDN and treat the effect as an enhancement. Without support, the page simply doesn't move, which is fine.

css
.hero {
  position: relative;
  overflow: clip;
  isolation: isolate;          /* keeps the layer inside the hero */
  min-height: 80vh;
  view-timeline: --hero block;
}

.hero__bg {
  position: absolute;
  inset: -15% 0;               /* extra room so edges never show */
  background:
    radial-gradient(circle at 75% 20%, #7c3aed 0%, transparent 45%),
    linear-gradient(170deg, #0f0b1e 0%, #1e1b4b 100%);
  z-index: -1;
}

@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .hero__bg {
      animation: hero-depth linear both;
      animation-timeline: --hero;
    }
  }
}

@keyframes hero-depth {
  from { transform: translateY(-10%); }
  to   { transform: translateY(10%); }
}
The background layer moves a little as the hero passes through the viewport. It only runs where it's supported and where the visitor hasn't asked for reduced motion.

The size of the movement lives in the keyframes: 10% each way is gentle. Push it beyond 20% and the effect starts to feel like a ride. Moving transform rather than top or background-position keeps it cheap for the browser to draw. CSS gradient performance explains why large animated gradients should move, not repaint.

Other ways to build parallax scrolling

Scroll-driven animations

How it works

animation-timeline: view() or scroll() ties keyframes to scroll

Watch out for

Not yet in every browser; build it as an enhancement
background-attachment: fixed

How it works

The background stays still while content scrolls over it

Watch out for

Ignored by iOS Safari; only one fixed speed
CSS 3D perspective

How it works

Layers pushed back with translateZ scroll more slowly

Watch out for

Fiddly scaling and scroll container setup
JavaScript on scroll

How it works

A script moves layers as the page scrolls

Watch out for

Can stutter if it runs on every scroll event; use requestAnimationFrame
MethodHow it worksWatch out for
Scroll-driven animationsanimation-timeline: view() or scroll() ties keyframes to scrollNot yet in every browser; build it as an enhancement
background-attachment: fixedThe background stays still while content scrolls over itIgnored by iOS Safari; only one fixed speed
CSS 3D perspectiveLayers pushed back with translateZ scroll more slowlyFiddly scaling and scroll container setup
JavaScript on scrollA script moves layers as the page scrollsCan stutter if it runs on every scroll event; use requestAnimationFrame
Four techniques. For a new site, scroll-driven animations are the cleanest choice.

Parallax and reduced motion

For people with vestibular disorders, large movement triggered by scrolling can cause dizziness and nausea. WCAG's guidance on animation from interactions asks that motion like this can be turned off. The simplest way to respect that is to wrap parallax in prefers-reduced-motion: no-preference, as in the code above, so it only runs for visitors who haven't asked for less motion. Prefers reduced motion covers the media query and how to test it.

Avoid

  • Whole sections sliding at different speeds
  • Text or buttons on moving layers
  • Movement that ignores reduced motion settings
  • Scroll hijacking that changes scroll speed
  • Parallax on every section of the page

Do

  • One background layer moving a little
  • Content on the normal scroll
  • Motion only under no-preference
  • Native scrolling, untouched
  • Parallax in one place: usually the hero

Parallax in motion design and video

Parallax isn't only for scrolling. In a moving post, a loop or a title sequence, the same rule creates depth over time: a background that drifts slowly, light or particles that move slightly faster, and words that hold still in front. That last part matters. Still words on a gently moving field read as calm and confident, while words that drift too look unsettled.

Northfield Outdoor
Built for the long haul.
The autumn range is here
Gradiently · @gradiently

A website hero with depth: the background field moves slowly behind still words, so the eye reads the headline first.

Particles are a natural middle layer: particle effects shows how small, faint specks moving slightly faster than the background add a second plane of depth. Keep every layer's motion slow and eased; motion design principles explains why.

Designing a parallax hero, step by step

  1. 1

    Design it still first

    The hero must look finished with no movement at all, because that's what reduced motion visitors and unsupported browsers will see.

  2. 2

    Separate the layers

    Put the background colour field on its own layer, any shapes or photos on a second, and the headline and button on the page itself.

  3. 3

    Move only the back layer

    Start with the background alone moving 10% each way. Add a middle layer only if the depth needs it.

  4. 4

    Test on a phone

    Check it scrolls smoothly on a mid range phone, and that nothing jumps on iOS Safari.

  5. 5

    Turn on reduced motion and check again

    In your system's accessibility settings, ask for reduced motion and confirm the page is calm and complete.

Three gradient layers for a parallax hero. Stacked, with the far layer moving least, they read as sky, horizon and foreground.

For the background layer itself, a living gradient does more than a flat one. A Gradiently Mark exported as a seamless WebM or MP4 loop with Pro, set behind your hero, gives the page a back layer that is already moving gently and belongs to you alone once claimed. Pair it with hero section design and website hero backgrounds for sizing.

Find a gradient that’s only yours

Browse thousands of Marks, design with any of them for free, and claim the one that feels like you.

Browse the Market

Questions people ask

What is a parallax effect?

A way of creating depth by moving layers at different speeds, so nearer layers move faster than distant ones, as they do in real life.

Can I make a parallax effect with only CSS?

Yes. CSS scroll-driven animations tie keyframes to scroll position without JavaScript, in browsers that support animation-timeline. Older pure CSS methods use background-attachment: fixed or 3D perspective.

Why doesn't background-attachment: fixed work on iPhone?

iOS Safari ignores fixed background attachment, so the background scrolls normally. Use scroll-driven animations or a transform based technique instead.

Is parallax scrolling bad for accessibility?

Large scroll-triggered movement can make people with vestibular disorders feel unwell. Keep it subtle and turn it off when a visitor prefers reduced motion.

Is parallax bad for performance?

Not if you animate transform and let the browser drive it with scroll-driven animations. Scripts that move elements on every scroll event are what cause stutter.

Share this guide

Written by GradientlyVerified Gradiently account

The team behind Gradiently, a design tool built around Marks: living gradients that make everything you design look like yours.

See our profile

On this page

How parallax creates depthParallax effect in CSS with scroll-driven animationsOther ways to build parallax scrollingParallax and reduced motionParallax in motion design and videoDesigning a parallax hero, step by step

Share this guide

Next in Motion

Motion graphics for brands that don't make video

Keep reading

All Motion guides
CSS and web

Hero section design: the first screen of your website

5 min read

Visitors decide whether to stay before they scroll. The hero is where they decide, so every word and pixel in it should earn its place.

Motion

Prefers reduced motion: animation everyone can use

5 min read

For some people, a parallax scroll or a zooming hero isn't delightful; it's dizzying. One setting tells you who they are. Here is how to respect it without losing your design.

Backgrounds

Website hero background: gradients that look rich and load fast

5 min read

The hero is where a site makes its first impression, and where it most often gets slow. A gradient hero can be both the richest and the lightest thing on the page, if you build it the right way.

Find the look that’s only yours.

Every Mark is a living background with one owner. Try an unclaimed Mark, and claim yours when it feels right.

Start designing

Check a certificate

Type a certificate number or a Mark’s code to see who owns it.

Works with ChatGPT and Claude

Ask your AI for a design. It makes it in your Mark, ready to edit.

ChatGPTClaude
How to connect

Product

  • Market
  • Explore
  • Pricing
  • Certificates

Learn

  • Field Guide
  • Help centre
  • What’s new

Developers

  • Overview
  • ChatGPT and Claude
  • API reference
  • API keys

Company

  • About
  • Contact us
  • Sign in

Legal

  • Terms
  • Privacy
  • Refunds
  • Mark protection
  • Cookies
  • All policies
Move through the letters. Each one wears a real Mark.Touch a letter to see its Mark.One name. Ten Marks inside it.
© 2026 Gradiently