CSS Ken Burns Effect
A slow zoom and pan across full-bleed frames, crossfading so the picture feels like it is breathing.

The Ken Burns effect is a slow zoom and a slow pan on a still image, named for the documentary move that keeps a photograph from feeling frozen. On the web it is the hero treatment people look up when a stock photo feels flat and a video is too heavy. The CSS version is two animations on an oversized frame: one scales and translates, one fades the frame in and out so several stills can share the same stage.
The demo uses painted gradients instead of photographs so the snippet has no image dependency. Swap background-image for url(/your-photo.jpg) and the same keyframes apply. Keep the type in a separate layer. If the words scale with the photo, the headline crawls and nobody can read it.
Related: the parallax image gallery moves images against scroll. The video background hero is the version where the frame really is footage. Ken Burns is the still that pretends, cheaply, to be footage.
Two animations, one element
.frame {
position: absolute;
inset: -8%;
animation: pan 18s ease-in-out infinite, fade 18s infinite;
}
@keyframes pan {
from { transform: scale(1) translate3d(0, 0, 0); }
to { transform: scale(1.12) translate3d(-2%, -1.5%, 0); }
}
@keyframes fade {
0% { opacity: 0; }
8% { opacity: 1; }
33% { opacity: 1; }
42% { opacity: 0; }
100% { opacity: 0; }
}
inset: -8% gives the scale and the pan room inside overflow: hidden so the edges of the photo never show a gap. A scale of 1.12 over 18 seconds is about as fast as this effect should go. Faster and it becomes a zoom transition, which is a different search and a more aggressive feeling.
The fade keyframes hold the picture for roughly a third of the loop and crossfade at the ends. Each frame’s animation-delay is a third of the duration (0s, 6s, 12s on an 18s loop) so one picture is always the visible one.
Direction
Alternate the pan. The demo drifts up and left. The next frame can drift down and right by changing the translate on that nth-child. If every frame travels the same way, the cut is less visible and the sequence feels like one broken zoom. Opposite drift makes the edit feel intentional.
ease-in-out on the pan keeps the start and end from jerking when the loop restarts. Linear looks mechanical on a photograph. It is the right curve for an orbit and the wrong curve here.
Photos
Use images that survive a 12% crop. A face near the edge will leave the frame. A subject in the middle third will not. Set background-size: cover and a background-position that protects the subject, then let the transform do the move. Do not also animate background-position unless you want two pans fighting.
Large photographs should be sized for the hero, not dropped in at camera resolution. The effect does not make a 8MB file acceptable. It makes a well-sized still feel less static.
Reduced motion
Show the first frame at opacity 1 with no transform animation, and hide the others. A crossfade that never settles is motion. A single still is the reduced-motion version of a slideshow, and it is the right one.
The headline sits above the frames, in real text, with a small kicker. It does not depend on the picture to say what the page is.
Questions about the Ken Burns effect
How do I make a Ken Burns effect in CSS?
Put the image in a frame that is slightly larger than its crop, hide the overflow, and animate transform from scale(1) to about scale(1.12) with a small translate over 15 to 20 seconds. Ease in and out.
How do I crossfade several Ken Burns images?
Give every frame the same duration and a fade keyframe that is visible for about a third of the loop. Delay each frame by that fraction. One image is opaque while the others are transparent.
Should the headline zoom with the photo?
No. Keep type in its own layer. The photograph moves. The words stay where they can be read.