What is Cumulative Layout Shift (CLS)?

On this page
  1. Why CLS is Critical for Your Website
  2. Understanding the CLS Score
  3. Common Causes of Layout Shifts
  4. How to Fix CLS on Your Website
  5. Summary

Cumulative Layout Shift (CLS) is a Core Web Vital that measures the “visual stability” of a website. It quantifies how much the content on a page jumps around while it is still loading.

You have likely experienced this: you are about to click a link, but suddenly an image or an ad loads, the text shifts downward, and you end up clicking the wrong thing. This “unstable” behavior is what CLS measures. For a mybox-hosted site, maintaining a low CLS is a mechanical necessity to ensure a professional and frustration-free user experience.

Why CLS is Critical for Your Website

  • User Frustration: Unexpected layout shifts are one of the most annoying aspects of web browsing. They can lead to accidental clicks, form resets, or users losing their place while reading.
  • Google Ranking: Since 2021, CLS has been a direct ranking factor. Google penalizes sites that provide a “jittery” experience.
  • Trust and Professionalism: A site that loads smoothly feels high-quality and reliable, whereas a site that jumps around feels broken or unoptimized.

Understanding the CLS Score

CLS is not measured in seconds, but as a calculated score based on how much elements move and how far they travel.

Rating Score Status
Good 0.1 or less The page feels solid and stable.
Needs Improvement 0.1 – 0.25 Noticeable shifting that should be addressed.
Poor Over 0.25 Highly unstable; significant impact on UX and SEO.

Common Causes of Layout Shifts

If your mybox-hosted site is struggling with a high CLS, it is usually due to one of these five culprits:

  1. Images without Dimensions: When you don’t specify the width and height of an image, the browser doesn’t know how much space to reserve. Once the image downloads, it suddenly “pushes” the surrounding content.
  2. Ads and Embeds: If you use third-party ads (like Google AdSense) or YouTube embeds that don’t have a reserved “placeholder” box, they will snap into place and shift the rest of the page.
  3. Dynamically Injected Content: Banners or “newsletter signups” that appear at the top of the screen after the page has already loaded.
  4. Web Fonts (FOIT/FOUT): When a custom font loads, it may be a different size than the fallback font, causing the text to reflow and shift paragraphs.
  5. Animations: Using CSS properties that change the layout (like top or margin) instead of those that don’t (like transform: translate()).

How to Fix CLS on Your Website

To stabilize your layout and improve your score, apply these fixes:

  • Set Explicit Dimensions: Always include width and height attributes in your <img> and <video> tags. This allows the browser to create a “box” for the media before it even starts downloading.
  • Reserve Space for Ads: Use a container (a div) with a fixed height for ads. If the ad fails to load, the space stays blank rather than collapsing and causing a shift.
  • Avoid Inserting Content Above Existing Content: If you need to show a banner, place it at the bottom of the viewport or use a fixed overlay that doesn’t push the main content.
  • Use Font Preloading: Use <link rel="preload"> for your main web fonts to ensure they are available as early as possible.
  • CSS Transform: When animating elements, use transform and opacity instead of changing positioning properties that trigger a layout recalculation.

Summary

CLS is the difference between a site that feels “expensive” and one that feels “cheap.” By ensuring your mybox-hosted site has a stable layout, you protect your conversion rates and your search engine rankings. A stable site is a reliable site.

Didn't find an answer?

Our support team is here for you 24/7 – write to us and we will help you sort it out.