Core Web Vitals, exactly · core
CLS: the score, session windows, causes and fixes
CLS is a unitless score: each unexpected layout shift scores impact fraction times distance fraction, shifts are grouped into session windows (gaps under 1 s, at most 5 s long), and CLS is the largest window's total; good is 0.1 or less.
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceThe notes
What you must know
- Layout shift score = impact fraction x distance fraction. Impact fraction = share of the viewport covered by the moving elements (before + after). Distance fraction = how far they moved / the viewport's larger side.
- Session window: shifts less than 1 second apart join the same window; a window lasts at most 5 seconds. CLS = the biggest window total, not the sum over the whole visit (this changed in 2021).
- Shifts within 500 ms after a click, tap or key press are expected and excluded (hadRecentInput). Scrolls do not count as input for this rule.
- CLS is measured for the whole visit, not just load. Infinite scroll, late banners and ads after load all count.
- Causes: images/iframes/ads without reserved size, content inserted above existing content, web fonts that swap with different metrics, animations of top/left/height.
- Fixes: width and height attributes or CSS aspect-ratio on media; reserve min-height for ads and banners; skeletons with the final size; insert new content below or on user action; animate transform and opacity; font fallback matching with size-adjust or font-display: optional.
- Transforms do not cause layout shifts, because they do not change layout. A bfcache restore resets CLS to 0.
The red pen
Common traps: mistake → fix
Mistake: "CLS is 0.5 seconds"
Fix: CLS has no unit; it is a score. Good <= 0.1, poor > 0.25.
Mistake: "CLS only happens during page load"
Fix: it is measured for the whole visit; lab tools only see the load part.
Mistake: "Every layout change is a layout shift"
Fix: only unexpected moves of existing elements count; changes right after user input and transform animations do not.
Mistake: "CLS adds up every shift in the visit"
Fix: it takes the largest session window.
Easy to hard
Questions interviewers ask, easy to hard
- What is CLS and what unit does it have? What is a good value?
- How is one layout shift scored?
- What is a session window and why was it introduced?
- A page with ads, images and a late 'download our app' banner has CLS 0.32. How do you fix it?
- Why can lab CLS be 0.02 while field CLS is 0.2?
Practise
Practise with these questions
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceYour first interview is free
Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.