How to improve CLS: Identify layout shifts, then address dimensions, dynamic content, and fonts

ProcrustesPR

Improving CLS (Cumulative Layout Shift) means reducing unexpected layout movement: first use PageSpeed Insights to identify problems, then reserve space for images, videos, and ads, and check dynamically inserted content and font swaps. CLS measures visual stability, not simply loading speed. You can aim for a score below 0.1 to help prevent links or buttons from suddenly moving just as users are about to click them.

ProcrustesPRProcrustesPRHow Should a CMS Handle Images? From Upload Optimization to Descriptions and URL Management

Find what is moving, not just the overall score

Enter the URL you want to check into PageSpeed Insights, and review the CLS results and diagnostic recommendations for both mobile and desktop. Results may differ between devices, so do not assume a page is fine on mobile just because it looks fine on desktop. If the report includes data on real visitors’ experiences, review that as well rather than relying solely on your own browsing experience.

Focus on media without specified dimensions, ads that appear suddenly, and text layout changes after fonts load. Not all movement needs to be eliminated. For example, a menu expanding within 500 milliseconds in direct response to a user’s click is an expected shift and should not affect the CLS score.

Images and videos: Reserve space before they load

When an image lacks width and height information, the browser may be unable to reserve enough space in advance, causing the image to push existing content out of the way when it appears. Provide the media’s dimensions or aspect ratio so the browser can reserve space ahead of time.

  • Set width and height for images and videos to provide dimension information.
  • When media needs to scale with the screen, use the CSS aspect-ratio property to maintain the appropriate proportions and reserve space.
  • Check whether embedded content also lacks dimensions, rather than addressing only regular images.

For example, if there is already text below an article image, reserving space lets the image fill that area when it loads, reducing the likelihood of pushing the text down. The issue here is space allocation, not just image file size.

Ads and dynamic content: Avoid sudden shifts in the main content

Ads, cookie banners, and content inserted later can all cause shifts when they change the layout. If content will appear above the existing main text, reserve enough space for it in advance rather than increasing the block’s height only after the data loads.

For example, if there is an ad slot at the top of an article, reserve that space before inserting the ad. The key is not simply whether an ad is present, but whether it moves content that users are reading or about to click.

Font swaps: Hiding text does not necessarily improve stability

When fallback and web fonts differ substantially in line height, character spacing, or other measurements, swapping fonts can change the layout. Check the layout before and after the font loads, and choose an appropriate fallback font rather than focusing only on the text’s final appearance.

web.dev specifically notes that shifts with font-display: swap may look more jarring than those with block, but generally do not result in worse CLS. This is because the browser still lays out the page using the fallback font even when block temporarily hides the text. Switching to block therefore does not guarantee that shifts caused by font swaps will disappear.

ProcrustesPRProcrustesPRHow should images of different sizes on the same website be named?

Improving CLS: perspectives from across the web

Which pages should you address first when scores are poor?

Prioritize important pages or those with poorer test results. Start by checking the homepage, category or listing pages, and content or product pages, then decide which to fix first based on their importance and test results. If you are unsure how to make changes, discuss the problem pages and diagnostic results with a developer.

What if you know CLS is high but cannot see what is moving?

Use WebPageTest's layout shift highlighting and loading screenshots to observe, frame by frame, when content changes. The source article used larger thumbnails and shorter screenshot intervals to identify layout changes before and after a custom font was applied. This helps pinpoint suspicious moments so you can then inspect the elements loaded or inserted at those times; the overall score alone does not readily reveal how the movement occurred.

Can responsive or compressed images alone solve CLS problems?

A smaller image file alone does not establish that CLS has improved. Responsive images can serve more appropriately sized images to smaller devices, reducing unnecessary data transfer. But layout stability still depends on whether dimension or aspect ratio information is available before images load, allowing the browser to reserve space. Image loading speed and layout shifts should be checked separately.

What other options are there for avoiding shifts caused by custom font swaps?

If the design allows it, consider system fonts to avoid downloading web fonts and swapping them in later. When custom fonts are necessary, tenten's article recommends combining preloading with font-display: optional. If the font does not load in time, the page uses the default font on the initial load; the custom font may appear on subsequent loads once cached. Use this approach only if you can accept that the font displayed may vary depending on loading conditions.

What should you watch out for with pop-ups and animations?

Avoid automatically displaying pop-up content that changes the layout without user interaction. For animations, favor simple, continuous transitions rather than making elements jump around. The key is to check whether they move content that users are reading or about to click, rather than banning all pop-ups or animations.

ProcrustesPRHow many image variants should you prepare, and how should you manage them?

References

  1. Optimize web fontsweb.dev — Source used in the article above.
  2. Core Web Vitals (核心頁面指標) 是什麼及如何優化-完整版tenten.co · 2022-06-30T16:51:16.000Z — Discusses: What if you know CLS is high but cannot see what is moving?; What other options are there for avoiding shifts caused by custom font swaps?
  3. PageSpeed Insights (PSI) 是什麼? 對SEO有影響?www.da-vinci.com.tw · 2022-09-30T12:47:58+08:00 — Discusses: What should you watch out for with pop-ups and animations?
  4. Google’s Core Web Vitalsneilpatel.com · 2024-09-16T19:00:00+00:00 — Source used in the article above.
  5. Measure Core Web Vitals with Semrush Site Auditwww.semrush.com · 2021-03-09T18:30:00Z — Source used in the article above.
  6. Cumulative Layout Shift: What It Is & How to Improve Your Scorewww.semrush.com · 2024-04-26T09:59:00Z — Source used in the article above.
  7. CLS 是什麼?CLS 評分標準、優化 4 方法一次看welly.tw · 2025-02-24T07:49:43.232Z — Source used in the article above.
  8. 新聞與媒體的SEO決勝攻略-從四大公投剖析新聞網站經營策略www.awoo.ai · 2022-01-28T02:48:32+00:00 — Discusses: Can responsive or compressed images alone solve CLS problems?
  9. SEO重點項目:網站速度測試、速度優化指南www.yesharris.com · 2023-10-04T15:36:05+08:00 — Source used in the article above.
  10. Screaming Frog SEO Spider Update – Version 19.0www.screamingfrog.co.uk · 2023-07-17T09:44:30+00:00 — Discusses: Can responsive or compressed images alone solve CLS problems?
  11. SEO定義是什麼? 2026最新版SEO搜尋引擎網站排名優化全攻略www.awoo.ai · 2024-11-21T10:16:39+00:00 — Discusses: Which pages should you address first when scores are poor?
  12. 13 Advanced SEO techniques & strategies for 2026www.semrush.com · 2020-10-28T14:32:00Z — Discusses: Which pages should you address first when scores are poor?

Related articles

How Should a CMS Handle Images? From Upload Optimization to Descriptions and URL ManagementHow should images of different sizes on the same website be named?How many image variants should you prepare, and how should you manage them?How do visual and short-form video trends in search results affect SEO?How can photography websites use SEO to increase visibility and attract clients?How can service and e-commerce websites improve search visibility? Start by distinguishing local needs from buying intentWhy optimize a website, and which tasks can be done for free?How can you use search results page features to attract traffic?
ProcrustesPR
ProcrustesPR