property
Scroll behavior — CSS reference
Controls scrolling initiated by navigation or CSSOM scrolling APIs when behavior is auto. It does not dictate user-driven scroll gestures; browsers may ignore smooth behavior and choose duration and easing. Prefer auto under reduced-motion preferences.
Formal Syntax & Structure
css syntaxcss
scroll-behavior: smooth;Working Example
Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>scroll-behavior</title><style>body{margin:0}#a{padding:8px;background:rgb(232,237,241);color:rgb(0,0,0);box-sizing:border-box}#outer{width:250px;height:200px;overflow:auto}#s{width:200px;height:100px;overflow:auto}#a{height:300px;width:320px}#s{scroll-behavior:smooth}@media(prefers-reduced-motion:reduce){#s{scroll-behavior:auto}}</style><body><div id="outer" tabindex="0" aria-label="Outer scroll region"><div id="s" tabindex="0" aria-label="Inner scroll region"><div id="a">Scroll here, then reach the boundary.</div></div><div style="height:500px">Outer content</div></div><button onclick="document.querySelector('#s').scrollTo({top:150})">Scroll down</button></body></html>