A field guide to depth on the web
Parallax
scrolling.
A page moves forward. Its layers drift at their own pace. The result is a little depth—and a more memorable way to tell a story.
Start with a clear frame.
Bootstrap 5.3 does not include a built-in parallax component. It gives us a dependable responsive grid and controls; a small, progressive CSS layer creates the depth.
Let the image
take its time.
A single photographic layer moves gently as the page passes by.
translate3d() + requestAnimationFrameFour types.
Each with its own purpose.
Each example is separated into its own titled and explained panel. The first two both use three image layers, with a different movement rule.
Three planes, three speeds
Far, middle, and near images each move at a different vertical speed. Their separation creates a clear depth effect as one scene passes through the viewport.
One image, two vertical extremes
The middle image travels from its upper position to its lower position as the scene crosses the viewport. A calm background and a slower foreground layer make the full three-layer movement easy to see.
Horizontal passage
Wide image panels slide in opposite directions while the reader scrolls down. A useful accent for a gallery or an editorial sequence.
Slow zoom reveal
The image scales subtly as it crosses the viewport. It adds presence to a hero image without competing with the copy.
One moving image.
Two steady moments.
This pattern places a tall image between two regular content blocks. While the page moves down, the background image shifts vertically at a different speed.
Give the story a place to pause.
The first block introduces an idea in a calm, readable layout. Then the moving landscape creates a visual bridge.
Arrive with a fresh point of view.
The second block continues the page after the image has done its work. The content remains in normal document flow and works without motion.
Depth comes from difference.
Each layer receives a small offset based on its scene’s position in the viewport. The page itself keeps its normal flow and scroll behavior.
+
X
Layer
Separate foreground, middle ground, and background into independent images or shapes.
Set the pace
Use a small speed factor. Less movement usually feels more polished and keeps text readable.
Keep it in view
Update only visible scenes, batch work into one animation frame, and animate transforms rather than layout.
<div class="parallax-scene">
<img class="parallax-layer"
src="..."
alt="...">
<div class="content-layer">...</div>
</div>
.parallax-layer {
transform: translate3d(0, var(--offset-y), 0);
will-change: transform;
}
For simple scenes, CSS scroll-driven animations can be a progressive enhancement. JavaScript gives wider browser coverage and lets this guide respect reduced motion.
The new parallax is more intentional.
Current motion design uses depth to clarify the story—not to make every part of the page move.
Subtle over spectacular
Small offsets preserve a sense of place and keep the experience from feeling like a roller coaster.
One focal layer
Photographic depth, a cutout object, or a single typographic detail can do more than a stack of effects.
Motion that adapts
Touch devices get less travel, shorter scenes, and a clean static fallback when motion is not available.
Motion tied to progress
Scroll-driven animation makes movement feel connected to the reader’s pace instead of running on a timer.
A good test: turn the effect off. If the image, message, and hierarchy still work, the depth is helping rather than carrying the page.
Make depth feel comfortable.
Motion should support orientation and atmosphere while leaving people in control.
Bootstrap 5.3 responsive breakpoints- Respect reduced motion
Disable scroll-linked transforms when a visitor asks for less motion.
- Keep meaning in the document
Use real content and logical reading order; do not make depth carry essential information.
- Use restrained travel
Large, rapid movement can cause discomfort and make it harder to follow text.
- Protect performance
Use appropriately sized images, lazy-load offscreen scenes, and animate transforms only.
- Keep a static fallback
The story should remain complete when JavaScript or motion is unavailable.
Depth is not a destination.
It is a way to guide the eye.
A little farther.
A little deeper.
Three full-screen moments. Let each image arrive at its own pace, then follow the story into the next frame.
01 03The quiet
begins here.
Let the horizon move slowly. Give the eye a place to land before the story opens.
Continue the journeyFollow
the line.
Two directions cross. The world shifts around one steady thought.
Move toward the lightSomewhere
new.
The frame settles. The image comes closer. The story leaves room for what happens next.
Return to the field guideThe middle image
moves between them.
The background holds the scene. A framed image travels vertically from one extreme to the other. The front layer drifts at its own pace—so all three planes stay distinct.
One image.
Two extremes.
As the stage crosses the viewport, the center photograph travels from top to bottom relative to both surrounding layers.
The original
parallax effect.
This is the classic W3Schools pattern: the background image stays fixed to the viewport while normal content blocks scroll in front of it. The two image panels below use Lorem Picsum photography.
Scroll down.
The scene holds.
background-attachment: fixed;Content moves through the frame.
The image is attached to the viewport, while this light content block remains in the document flow. Keep the copy short and let the photo carry the atmosphere.
A second view.
The same calm motion.
background-position: center;That is the complete pattern: a fixed photographic background, readable content blocks in normal flow, and enough vertical space to reveal the movement.
Three layers.
One vertical journey.
Three separate image planes share one scene. The middle image travels only on the vertical axis from the upper mark to the lower mark. The background and foreground move at different, slower rates for a clear depth relationship.
Watch the
middle layer
travel.
Scroll through the frame. The center image rises and falls against the two surrounding layers.