
Key points
- CLS is good at 0.1 or less and poor above 0.25. It has no unit.
- Only unexpected shifts count. Movement within 500 ms of a click or tap is excluded.
- Most layout shifts come from images without dimensions, late-loading embeds and ads, injected banners and web fonts.
What CLS measures
A layout shift happens when a visible element changes its position between two frames without the visitor asking for it. Each shift gets a score: the impact fraction (how much of the viewport the moving elements affected) multiplied by the distance fraction (how far they moved, relative to the viewport). CLS then reports the largest burst of shifts, called a session window: shifts that occur within one second of each other, up to a maximum window of five seconds.
| Rating | CLS |
|---|---|
| Good | ≤ 0.1 |
| Needs improvement | 0.1–0.25 |
| Poor | > 0.25 |
Shifts that start within 500 milliseconds of a discrete user input (a click, tap or key press) are excluded, because movement the visitor caused is expected. Animations using transform do not count either, since they do not change layout.
The usual suspects
- Images and video without dimensions. The browser does not know how much space to reserve, so text below jumps when the file arrives.
- Ads, embeds and iframes that load late and push content down.
- Banners and notices (cookie bars, promo strips) inserted above content after the page has rendered.
- Web fonts that swap in with different metrics from the fallback font, making lines wrap differently.
- Content injected by scripts above what the visitor is already reading.
How to fix it
Reserve space for media
Set width and height attributes on images and video. Browsers use them to compute the aspect ratio before the file loads, as long as your CSS keeps the image responsive.
<img src="/img/team.jpg" width="800" height="450" alt="The support team at their desks">
img, video { max-width: 100%; height: auto; }
.video-embed { aspect-ratio: 16 / 9; }
Reserve space for ads and embeds
Give the container a fixed or minimum height (or an aspect-ratio) that matches the content that will fill it. If the ad does not load, keep the space or collapse it only below the viewport.
Insert new content below the fold, or in reserved space
Do not push existing content down after it has been shown. Put banners in a reserved slot, overlay them (fixed position), or add them below what the visitor is reading.
Tame font swapping
- Preload the main font file and use
font-display: swaporoptional. - Pick a fallback font with similar proportions, and adjust it with
size-adjust,ascent-overrideand related@font-facedescriptors so the swap barely moves the text.
Spot the culprit. Chrome DevTools highlights layout shifts in the Performance panel, and Lighthouse lists the elements that shifted in its “Avoid large layout shifts” diagnostic.
See also: Mobile-friendly checklist, Open Graph and social previews.
FAQ
Why is CLS 0 in the lab but poor in real data?
Lab runs load the page once and do not scroll. Real visitors scroll, which triggers lazy-loaded images and ads that shift content, and cookie banners or personalised content can appear later. Field data captures all of that.
Does lazy-loading images cause layout shift?
Only if the image has no reserved space. With width and height (or aspect-ratio) set, lazy-loaded images do not shift the layout when they arrive.
Do animations hurt CLS?
Animating transform and opacity does not cause layout shifts. Animating properties like top, height or margin can.