What is LCP? Complete Guide to Largest Contentful Paint
Master Largest Contentful Paint (LCP) - Google's key Core Web Vital for measuring loading performance. Learn what LCP is, why it matters for SEO, and how to optimize it.
Comprehensive guide to Cumulative Layout Shift (CLS). Learn what CLS measures, good CLS scores, common causes of layout shifts, and proven techniques to achieve visual stability.
Cumulative Layout Shift (CLS) is one of Google's three Core Web Vitals metrics. It measures visual stability by quantifying how much unexpected layout shift occurs during the entire lifespan of a page.
CLS captures user frustration when page elements move unexpectedly. Have you ever tried to click a button, only to have it shift and click something else? That's what CLS measures.
A layout shift occurs whenever a visible element changes its start position from one rendered frame to the next. CLS is calculated by multiplying the impact fraction (how much of the viewport shifted) by the distance fraction (how far elements moved).
CLS directly impacts user trust and conversion rates. When pages jump around unexpectedly, users feel the site is unreliable or broken. Studies show high CLS correlates with higher bounce rates.
Google includes CLS in Core Web Vitals because it reflects real user frustration. Poor CLS can lead to accidental clicks on ads or wrong links, creating terrible user experiences.
E-commerce sites are especially vulnerable to CLS issues. Imagine a user ready to click 'Add to Cart' when a promotional banner pushes the button down, causing them to click 'Remove from Wishlist' instead.
Images and videos without dimensions are the most common CLS culprit. When the browser doesn't know the size of media in advance, it first renders with zero height, then shifts content when the media loads.
Web fonts that load after text has rendered cause FOIT (Flash of Invisible Text) or FOUT (Flash of Unstyled Text), both of which create layout shifts as text re-renders with different dimensions.
Dynamically injected content like ads, embeds, or iframes often cause massive shifts because space isn't reserved for them in advance.
Always include width and height attributes on images and videos. Modern browsers use these to calculate aspect ratios before the media loads, reserving the correct space.
Use CSS aspect-ratio or padding-bottom hacks to reserve space for dynamic content like ads and embeds. If an ad slot is 300x250, reserve that space even before the ad loads.
Preload web fonts and use font-display: optional or font-display: swap with fallback fonts that have similar metrics to minimize text reflowing.
Follow this systematic approach to eliminate layout shifts. Test your changes in Chrome DevTools Performance panel, which highlights layout shifts in red.
Use MakeWebsite.fast to monitor your CLS score over time. Field data in Chrome User Experience Report shows real-world CLS, which may differ from lab tests.
A good CLS score is under 0.1. Scores between 0.1-0.25 need improvement, and scores over 0.25 are considered poor. Like other Core Web Vitals, Google measures CLS at the 75th percentile of page loads.
Use Chrome DevTools Performance panel - record a page load and look for 'Layout Shift' entries. Click on them to see which elements shifted. The Lighthouse report also lists specific CLS issues with element selectors.
Only if they animate layout properties like width, height, top, or left. Animations using transform and opacity don't trigger layout shifts because they run on the compositor thread without affecting other elements.
Weekly tips to make your website faster
Join 5,000+ developers getting actionable performance optimization tips, Core Web Vitals updates, and speed testing insights.
No spam. Unsubscribe anytime.
Master Largest Contentful Paint (LCP) - Google's key Core Web Vital for measuring loading performance. Learn what LCP is, why it matters for SEO, and how to optimize it.
Everything you need to know about website speed testing. Learn how to test your site speed, interpret results, and fix common performance issues.