Cumulative Layout Shift (CLS): Preventing the Frustration of Jumpy Websites

7 min read

What is Cumulative Layout Shift?

Have you ever been reading an article when suddenly the text jumps down because an image or ad loaded? Or worse, have you ever been about to click a button when it moves, causing you to click something else entirely?

These frustrating experiences are what Cumulative Layout Shift (CLS) measures—the unexpected movement of page elements during loading. Think of it as measuring how "jumpy" or unstable a website feels while it loads.

What's a good CLS score?

  • Good: 0.1 or less (Barely noticeable movement)
  • Needs Improvement: 0.1 to 0.25 (Noticeable shifts)
  • Poor: Above 0.25 (Very disruptive movement)

Why Layout Shifts Make Visitors Leave Your Website

Layout shifts aren't just annoying—they can seriously impact how people use your website:

  • Accidental Clicks: When elements move, visitors may click the wrong thing, potentially leading to unwanted purchases, form submissions, or navigation.
  • Reading Disruption: Layout shifts make it difficult to read content, causing visitors to lose their place and become frustrated.
  • Impression of Unprofessionalism: A jumpy website feels unpolished and amateur, reducing trust in your brand.
  • Increased Bounce Rates: Frustration from layout shifts often leads to visitors leaving your site entirely.

Layout stability isn't just about user comfort—it's about creating a professional, trustworthy experience that keeps visitors engaged with your content and moving toward your business goals.

How CLS Works: The Science of Content Jumps

Cumulative Layout Shift is calculated by looking at two factors when content moves unexpectedly:

  • Impact Fraction: How much space the unstable element takes up in the viewport (what's visible on screen).
  • Distance Fraction: How far the unstable element moves relative to the viewport.

When an element moves, these two factors are multiplied together to create a "layout shift score." The Cumulative Layout Shift is the sum of all individual layout shift scores that occur during the entire loading process.

In simpler terms: bigger elements that move farther distances create worse CLS scores. A large image jumping halfway down the page is much worse than a small button shifting slightly.

Expected vs. Unexpected Shifts

Not all layout shifts are bad. Shifts that happen in response to user interaction (like clicking a "Read More" button that expands content) are considered "expected" and don't count toward your CLS score. Only unexpected shifts during the loading process are penalized.

How to Identify Layout Shifts on Your Website

Before you can fix layout shifts, you need to find them. Here are ways to identify layout stability issues on your website:

  • Your own experience: Browse your website as a visitor would, paying close attention to any content that jumps or moves unexpectedly.
  • Performance monitoring tools: Use tools that measure Core Web Vitals to get your CLS score and identify problem areas.
  • Session recordings: Watch recordings of real users navigating your site to see where they encounter layout shifts.
  • Ask for feedback: Have friends or colleagues visit your site and report if they notice content jumping.

Pay special attention to pages with dynamic content like image galleries, advertisements, or content that loads from external sources, as these are common sources of layout shifts.

9 Proven Ways to Fix Layout Shifts

1. Always Include Size Attributes for Images and Videos

When you don't specify dimensions for media, the browser doesn't know how much space to reserve until the media loads.

Simple fix: Always include width and height attributes in your HTML for all images and videos. For responsive images, use modern CSS techniques that maintain the aspect ratio.

2. Reserve Space for Ads

Advertisements are notorious for causing layout shifts because they often load after the main content.

Simple fix: Create a fixed-size container for each ad slot using CSS that matches the expected ad dimensions. This reserves the space even before the ad loads.

3. Use Font Loading Strategies

Custom fonts can cause text to reflow or shift when they load after the system font initially displays.

Simple fix: Use the font-display CSS property, preload important fonts, or consider using system fonts that don't require downloading.

4. Be Careful with Dynamic Content

Content that loads after the initial page render—like related posts, comments, or social media embeds—often causes shifts.

Simple fix: Reserve space for dynamic content with minimum height containers, use placeholders, or load this content at the top of the page where shifts are less disruptive.

5. Transform Animations Instead of Layout Properties

Animations that change layout properties like width, height, or position can cause layout shifts.

Simple fix: Use CSS transform for animations instead of properties that trigger layout changes. Transforms are processed separately from layout in the browser.

6. Load Content Above the Fold First

Content loading out of order can cause elements to push each other around as they appear.

Simple fix: Prioritize loading content that appears above the fold (visible without scrolling) before loading below-the-fold content.

7. Avoid Inserting Content Above Existing Content

Adding new elements above content that's already loaded (like notifications or alert banners) pushes everything down.

Simple fix: Reserve space for potential notifications, or add them to fixed positions that don't displace other content.

8. Be Careful with Infinite Scrolling

Infinite scrolling features can cause shifts when new content loads and pushes existing content in unexpected ways.

Simple fix: Implement infinite scrolling that adds content at the bottom without affecting the position of what the user is currently viewing.

9. Use Skeleton Screens for Loading States

Blank spaces that suddenly fill with content can cause layout shifts.

Simple fix: Implement "skeleton screens" that show the structure of the content before it loads, maintaining the same dimensions as the final content.

Common Layout Shift Culprits and Solutions

Problem: Images Without Dimensions

What's happening: When images load without predefined dimensions, they cause the content below to shift downward.

Simple solution: Always add width and height attributes to your image tags, and use modern CSS like aspect-ratio to maintain proportions while still having responsive images.

Problem: Cookie Consent Banners

What's happening: Cookie banners that appear after the page loads push content down or overlay important elements.

Simple solution: Use fixed or sticky positioning for consent banners so they don't displace other content, or pre-allocate space at the top of the page.

Problem: Third-Party Widgets

What's happening: Social media embeds, chat widgets, and review systems often load late and cause layout shifts.

Simple solution: Create fixed-size containers for all third-party content and ensure they don't exceed these boundaries when they load.

Problem: Web Fonts Causing Text to Reflow

What's happening: Custom fonts that load after the page displays can cause text to change size or spacing, shifting nearby elements.

Simple solution: Use font-display: optional or font-display: swap CSS properties, or preload critical fonts. Match fallback fonts closely to your custom font's dimensions.

How CLS Relates to Other Performance Metrics

Cumulative Layout Shift measures a different aspect of user experience than speed-focused metrics:

MetricWhat It MeasuresHow It Differs from CLS
First Contentful Paint (FCP)When the first content appearsFCP measures speed, while CLS measures stability regardless of how fast content loads
Largest Contentful Paint (LCP)When the main content is visibleLCP focuses on how quickly main content loads, while CLS focuses on whether content jumps after loading
Time to Interactive (TTI)When the page becomes usableTTI measures when users can interact with the page, while CLS measures if elements move unexpectedly during interaction
Total Blocking Time (TBT)When the page is unresponsiveTBT measures responsiveness delays, while CLS measures visual stability

CLS is unique because it can be excellent even on a slower site, and poor even on a fast site. It's about stability and predictability rather than pure speed.

Real-World Benefits of Fixing Layout Shifts

Companies that have prioritized eliminating layout shifts have seen significant improvements in user engagement and business outcomes:

  • News website reduced their CLS by 80% and saw a 25% increase in pages per session as readers could consume content without frustrating interruptions.
  • E-commerce platform fixed layout shifts on their product pages and experienced a 15% decrease in cart abandonment as customers could reliably click the "Add to Cart" button without it moving.
  • Financial services company improved CLS on their application forms and saw a 22% increase in form completions as users could fill fields without the form shifting underneath them.
  • Travel booking site eliminated shifts caused by image loading and noticed a 17% increase in booking conversion rates.

These examples show that layout stability directly contributes to creating experiences that users trust and can navigate with confidence.

Conclusion: Stability Creates Trust

Cumulative Layout Shift may seem like a technical metric, but it's really about something deeply human: the expectation that things will behave predictably. When elements on your website jump around unexpectedly, it breaks this fundamental expectation and erodes trust.

Imagine trying to have a conversation with someone who keeps jumping to different spots in the room mid-sentence—it would be maddening! Layout shifts create this same feeling of instability and unpredictability for your website visitors.

By focusing on reducing CLS, you're creating a more stable, professional experience that respects your visitors' attention and builds confidence in your brand. A stable layout tells visitors that you care about details and their experience—which translates into longer visits, higher engagement, and better conversion rates.

Ready to create a more stable website experience?

Greadme's easy-to-use tools can help you identify exactly what's causing layout shifts on your website and provide simple, step-by-step instructions to fix the issues—even if you're not technically minded.

Stabilize Your Website Today