Skip to content

Embedding and web termsUpdated

Cumulative Layout Shift (CLS)

Also called: CLS, layout shift

Definition

Cumulative Layout Shift (CLS) is a Core Web Vitals metric for visual stability: it measures how much visible content moves unexpectedly while a page is open. web.dev rates a score of 0.1 or less as good and anything above 0.25 as poor.

How CLS is scored

  • A layout shift happens when a visible element changes position from one frame to the next.
  • Shifts within 500 milliseconds of a tap, click or key press are treated as expected and left out.
  • Shifts are grouped into session windows: bursts with less than a second between shifts, lasting at most five seconds.
  • A page's CLS is the score of its worst window, judged at the 75th percentile of page loads, separately for mobile and desktop.

How embeds cause shifts

web.dev names third-party ads and widgets that resize themselves among the usual causes, along with images and videos of unknown size, web fonts that render at a different size from their fallback, and content inserted above what's already on screen. An embed that starts as a short box and then grows pushes everything below it down; if that happens in view, it counts.

Keeping embeds from shifting the page

  • Reserve space: give the embed's container a min-height close to its final height.
  • Place feeds and other tall embeds below the first screen where you can; shifts out of view don't add to the score.
  • Set width and height on images so the browser knows their shape before they load.
  • Don't insert banners or embeds above content the visitor is already reading.
  • Check field data in PageSpeed Insights or Search Console after launch, not just a single lab test.

LinkedInEmbed's script snippet creates each frame at a modest starting height and then resizes it to fit. For a widget that's visible when the page opens, a min-height on its wrapper reduces the jump.

Related terms

Core Web Vitals
Core Web Vitals are three metrics that describe a page's real-world user experience: Largest Contentful Paint for loading, Interaction to Next Paint for responsiveness and Cumulative Layout Shift for visual stability. Each has a published “good” threshold.
Auto-resizing iframe
An auto-resizing iframe changes its height to match the content inside it, so there's no inner scrollbar or empty gap. Because a page can't measure a cross-origin frame's content, the frame reports its height with postMessage and a script on the host page applies it.
Lazy loading
Lazy loading means the browser waits to load an image or iframe until the visitor scrolls near it, instead of fetching everything as the page opens. In HTML you turn it on by adding loading="lazy" to <img> and <iframe> elements.
iframe
An iframe (inline frame) is an HTML element, <iframe>, that displays a separate web page inside the current one. The embedded page loads from its own address and runs as its own document, kept apart from the host page's styles and scripts.

Show your LinkedIn on your website

Paste a LinkedIn URL and embed it with one snippet. Free plan, no credit card.

Create a free widget

Full glossary A–Z

Put your LinkedIn on your website today

Create your first widget in about two minutes. Free plan, no credit card required.