Find what moves your page while it loads, and why

Avoid large layout shifts was the Lighthouse diagnostic that listed the biggest layout shifts during a page load and the element that moved most in each. Lighthouse 13 replaced it with the Layout shift culprits insight, which groups shifts into clusters, picks out the worst one and suggests likely causes: an unsized image, an injected iframe, a web font or an animation. It passes when the test's Cumulative Layout Shift is 0.1 or less. The element listed is the one that moved, which often isn't the one to fix, so look at what appeared or grew just before it.

What the Layout shift culprits insight shows

  • Worst cluster

    Shifts that happen close together are grouped into a cluster, and the insight picks out the one with the highest score, since CLS takes its value from the worst burst rather than adding up every shift.

  • Unsized image element

    An image with no width and height, so the browser reserved no room for it and moved the content below once the file arrived.

  • Injected iframe

    An iframe added after the page started rendering, such as an ad or an embed, that opened a gap for itself.

  • Web font

    A font that finished downloading and replaced the fallback, changing the size of the text set in it.

  • Animation

    An animation the browser couldn't hand off to the compositor, such as one that changes height or top, so it moved the layout around it.

Chrome's Layout shift culprits docs give the 0.1 pass mark and the common culprits. The insight's source code names up to three causes per cluster, and the Lighthouse 13 release notes list it as the old audit's replacement.

Why the element listed often isn't where the fix goes

  • A layout shift record names the elements that moved, not what moved them. web.dev's guide to debugging layout shifts says the element just before the shifted one is the most likely cause: check whether it changed size or position, and whether something was inserted or removed above the content that moved.

  • The size of the shift is a clue too. The same guide notes that a large downward shift often means an element was inserted, while a shift of 1 or 2 pixels often comes from conflicting CSS or a web font loading. When the insight names no culprit, the shift can still be fixed; Chrome's docs say every layout shift can be mitigated.

How to fix large layout shifts

  1. Turn on Layout Shift RegionsIn DevTools, open the Rendering tab, enable Layout Shift Regions and reload. Areas that shift flash purple, which shows where to look before you open a trace.
  2. Record the load in the Performance panelEach diamond in the Layout shifts track is one shift, sized by its score. Click the biggest to see an animation of it, the elements that moved and the insight's suggested cause.
  3. Reserve space for content that arrives lateGive images and video width and height, and give ad and embed containers a minimum height. Don't collapse a container when no ad arrives, or the content below moves twice.
  4. Animate without moving the layoutReplace animations of top, left, height or margin with transform, which moves an element on screen without pushing anything around it.
  5. Check the page after load tooLighthouse only sees shifts during the first load. Scroll and use the page with the Performance panel's live metrics open to catch shifts the test can't.

Frequently asked questions

Why does Lighthouse find no culprit for a shift?

The insight can only suggest causes it recognizes: unsized images, injected iframes, web fonts and animations. Content your own script inserts, or a box that grows when data arrives, may come with no suggestion. Chrome's docs still say every shift can be fixed, so trace it from the element above the one that moved.

Can a page pass this insight and still fail CLS in Search Console?

Yes. The insight judges one lab load, and web.dev's debugging guide notes that Lighthouse can only identify shifts during that first load. Search Console's number comes from Chrome users' visits, and CLS counts shifts for the whole time each page stays open, so content that loads in as people scroll counts there and not here.