concept
Cumulative layout shift — CSS reference
CLS measures unexpected visual instability by grouping eligible layout-shift entries into session windows and taking the largest window score. Geometry movement alone is not a CLS measurement: eligibility and viewport impact matter. Reserving space prevents the following content from moving in this example.
Formal Syntax & Structure
css syntaxcss
Reserve image or placeholder space before content arrives.Working Example
Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>cumulative-layout-shift</title><style>body{margin:8px;font:16px/24px sans-serif;color:black;background:white}#a{box-sizing:border-box}#a{height:80px;width:120px;background:#ddd}#b{height:24px}</style><body><div id="a">Loading</div><div id="b">Following paragraph</div></body></html>