In this article · 6 sections
- Common causes
- How to find shifts
- Fixes
- 1. Always set image dimensions
- 2. Reserve space for embeds and ads
- 3. Stabilise fonts
- 4. Overlay, don't push
- 5. Load dynamic content into reserved space
- 6. Animate with transform
- 7. Skeletons that match final size
- Sliders and carousels
- Check after every design change
- FAQs
- Do shifts after user interaction count?
- Why is my CLS fine in tests but poor for real users?
You go to tap "Call now" and the page suddenly jumps; you tap an ad instead. That's layout shift, measured by the Core Web Vital Cumulative Layout Shift (CLS). A "Good" CLS is 0.1 or less. Here's how to fix cumulative layout shift on real websites.
Common causes
- Images and videos without dimensions
- Ads, embeds and iframes that load late and push content
- Web fonts swapping in with different sizes
- Banners and cookie bars inserted at the top after load
- Dynamic content (reviews widgets, "related posts") injected above existing content
- Animations that change layout properties
How to find shifts
- PageSpeed Insights: "Avoid large layout shifts" lists elements
- Chrome DevTools → Performance: Layout Shift entries highlight moving elements
- Search Console: CLS issues by page group
Fixes
1. Always set image dimensions
<img src="team.webp" width="800" height="533" alt="Our team">
Or use CSS aspect-ratio. See responsive images.
2. Reserve space for embeds and ads
.map-embed { aspect-ratio: 16 / 9; }
.ad-slot { min-height: 250px; }
3. Stabilise fonts
- Use
font-display: swapwith a well-matched fallback font - Preload the main font
- Consider
size-adjuston fallback fonts to match metrics
See web fonts and speed.
4. Overlay, don't push
Cookie bars, offer banners and chat buttons should overlay (fixed position) rather than insert content above the page.
5. Load dynamic content into reserved space
Give widgets a fixed-height container, or load them below the fold.
6. Animate with transform
Animate transform and opacity, not top, height or margin. See CSS animation tutorial.
7. Skeletons that match final size
Sliders and carousels
Sliders that resize as images load are a frequent CLS source. Give slides fixed dimensions, or replace sliders with a static hero.
Check after every design change
New banners, widgets and plugins often reintroduce shifts. Make CLS part of your monthly checks.
FAQs
Do shifts after user interaction count?
Shifts within a short time after a user interaction (like opening an accordion) are excluded from CLS.
Why is my CLS fine in tests but poor for real users?
Real users see ads, cookie consent, slow networks and different fonts. Field data captures these.
Joboo Web builds stable layouts with zero-jump hero sections. Get a free CLS check.
Was this article helpful?
Your answer helps us improve our guides