Cumulative Layout Shift: Why Your Page Jumps Around and How to Stop It

You go to tap a link and an ad shoves it down the page at the last second. That’s layout shift, Google measures it, and your site probably has more of it than you think.

SP

SAT Team

6 min read

You know the feeling. You're reading an article on your phone, you go to tap a link, and at the exact moment your thumb lands, an ad loads above it and the whole page lurches. You've just tapped something else entirely. Maybe bought something. Definitely sworn a little.

That's layout shift, and Google measures it with a Core Web Vital called Cumulative Layout Shift (CLS). Unlike LCP and INP, it isn't a time. It's a score that combines how much of the viewport moved and how far it traveled, summed across the worst burst of shifts during the visit. You want 0.1 or less. Above 0.25 is rated poor.

The good news: of the three Core Web Vitals, CLS is usually the easiest to fix. Most shifts come from a small handful of causes, and every one of them has a known cure.

Cause #1: Images without dimensions

The classic. Your HTML says "here's an image" but doesn't say how big it is. The browser renders the text first, then the image file arrives, and everything below it gets shoved down.

The fix is almost embarrassingly simple: put width and height attributes on every img tag. Modern browsers use them to reserve the right amount of space before the file loads, even in responsive layouts where CSS scales the image. If you're working with CSS instead, aspect-ratio does the same job.

This one habit, applied everywhere, fixes a huge share of real-world CLS on content sites.

Cause #2: Ads, embeds, and iframes

Ad slots are shift machines. The ad network decides the creative size at auction time, so the container starts at zero height and then explodes to 280px once the ad arrives, pushing your content down with it.

You can't control what the network sends, but you can control the hole it fills. Reserve space with a min-height on the slot container based on the most common ad size you serve. Yes, you'll occasionally show some empty padding when a smaller creative loads. That's a fair trade for a stable page, and it's exactly what Google's own publisher guidance recommends.

Same logic applies to YouTube embeds, social media widgets, and newsletter signup forms injected by JavaScript. If it loads late, box out its space early.

Cause #3: Web fonts swapping

Your page renders in a fallback font, then your custom font finishes downloading and every line of text reflows because the letters are a different width. Small individual shifts, but they add up, and they happen right while people are reading.

A few layers of defense:

  • Preload your main font file so it arrives before first paint
  • Use font-display: swap (or optional if you'd rather skip the swap entirely on slow connections)
  • Tune the fallback with the newer CSS descriptors size-adjust, ascent-override and descent-override so the fallback occupies nearly identical space
  • Or take the easy win: use a system font stack and skip the problem completely. Plenty of fast sites do.

Cause #4: Content injected above existing content

Cookie banners that push the page down instead of overlaying it. "Related posts" modules that appear mid-article after an API call. Notification bars added at the top after load. Anything inserted above what the user is already looking at will shift everything below.

Rule of thumb: late-arriving UI should either overlay the page (position it fixed or absolute) or slot into space you reserved in advance. Never insert into the flow above the fold after first paint unless the user asked for it by clicking something.

Cause #5: Animations done wrong

Animating height, top, or margin causes real layout recalculations, and the shifts can count against CLS. Animate transform and opacity instead. They're handled by the compositor, they're smoother, and they don't move anything else on the page.

How to actually find your shifts

Numbers first: PageSpeed Insights shows your field CLS from real Chrome users. But to find the culprits, open Chrome DevTools, run a Performance recording while the page loads, and look for the layout shift markers. Click each one and DevTools highlights exactly which element moved. There's no guessing involved.

Also test like a real visitor. Throttle the network to slow 4G. On a fast connection everything loads at once and shifts hide; on a slow one they play out in slow motion right in front of you. And scroll. CLS is measured across the whole page lifetime, not just the initial load, so a shifty infinite-scroll feed or a lazy section that pops in without reserved space still counts.

Edge cases worth knowing about

A few situations trip up people who've already fixed the basics.

Shifts you cause don't count; shifts you cause *late* do. Layout changes within 500ms of a user interaction are excluded from CLS, because the user asked for them. Click "load more," content appears, no penalty. But if that content arrives 800ms after the click because your API is slow, the shift counts. Fast responses to interaction aren't just good UX; they're literally scored differently.

Session windows changed the math. CLS is measured in windows of shifts (bursts up to five seconds long), and your score is the worst window, not the lifetime sum. So one chaotic moment during load can define your score even if the rest of the visit is stone stable. Find your worst burst in DevTools and concentrate there.

Fixed banners that "push" on scroll. Sticky headers that change height as you scroll (shrinking logos, appearing shadows are fine; height changes are not) can generate repeated small shifts across the whole session. Keep sticky element heights constant and animate the inner contents instead.

Skeleton screens can lie. Placeholders only prevent shift if they're the same size as what replaces them. A three-line skeleton swapped for eight lines of real text shifts everything below it just the same. Measure your real content and size the bones to match.

Why this metric deserves more respect than it gets

CLS often gets treated as the boring third vital, but think about what it protects. Misclicks on ads (which can get your ad account flagged, by the way). Lost reading position. That general feeling that a site is janky and untrustworthy. Users can't name the metric, but they absolutely feel it.

Reserve space for everything that loads late. Give images their dimensions. Overlay instead of inject. Do those three things consistently and your CLS problem mostly disappears, usually within a single sprint.

Check your own site in 30 seconds

Run a free SEO audit and see exactly where your pages stand on the issues covered in this article.

Run Free SEO Audit

Keep reading