Performance
How to Reduce CLS from Images, Fonts and Late Content
Trace the cause of a layout shift and reserve space for content that arrives after the first paint.
Watch what moves and what caused it
A layout shift happens when visible elements move unexpectedly. The text that jumps may be the victim of a change above it. Use the layout shift markers in a performance trace to see what moved, then watch the filmstrip for an image, font change, banner, or widget appearing just beforehand.
Test the page on a narrow phone viewport as well as desktop. A CMS card layout may look stable on desktop while an image or notice wraps on mobile and pushes the first button down. Inspect the same responsive breakpoints where the problem occurs.
Reserve the right amount of space
Suppose an audit results table arrives after a request and pushes the “Copy” button away from a user's finger. Keep the button with its own section or reserve an appropriate region where the table appears. For an image, explicit intrinsic width and height or CSS aspect ratio lets the browser reserve the intended space before download.
An advertising or embed slot may need a predictable minimum size per breakpoint. Design what happens when it is empty so the page does not jump during loading. For font shifts, compare the fallback font with the final face. Different line lengths and heights can move cards or text even when the font file is small.
Test slow loads and repeat visits
Record the page with a cold cache to catch missing image dimensions and delayed fonts. Then test a repeat visit and scroll through lower sections. Some shifts happen after the page is initially visible, especially when a banner or lazy block enters the layout. Record which actions reproduced the shift so the next release can be checked consistently.
Avoid a fix that hurts the current task
A large placeholder can prevent movement while simultaneously pushing the form below the first screen. Reserve space near where the response will appear, and keep the input and primary action stable. Test a result, a validation error and an empty response. All three states should fit the layout without causing a distracting jump. If the content needs to grow, prefer a natural expansion within its own section.
Frequently asked questions
Does every DOM update contribute to CLS?
No. The metric is about unexpected visible movement. Check the recorded shift and its relation to recent user input.
Can CLS increase after the initial load?
Yes. Inspect late widgets, banners, related content and layout changes during scrolling.
Should I hard-code every block's height?
Reserve predictable space where it helps and keep the design responsive. Fixed heights that clip text or leave large gaps create other problems.