Smooth scrolling

Also called smooth scroll or scroll-behavior: smooth

Animated scrolling that glides to a new position, such as the target of an anchor link, so readers can see where on the page they went.

What is Smooth scrolling?

By default, clicking a link to #pricing jumps there instantly, which can leave readers unsure whether they moved up or down the page. Smooth scrolling animates the trip: the page glides to the target over a few hundred milliseconds, and the reader keeps their bearings.

One line of CSS turns it on for anchor links and scripted scrolls: scroll-behavior: smooth on the scrolling element, usually html. In JavaScript, pass behavior: 'smooth' to scrollTo() or scrollIntoView(). Add scroll-margin-top to the targets so a sticky header doesn’t cover them.

Some sites also use libraries such as Lenis that smooth out mouse wheel scrolling itself. That changes how every scroll feels, so use it with care. Either way, respect prefers-reduced-motion and jump instantly for people who ask for less motion.

All terms

Scroll snap

A CSS feature that makes a scroll container settle on set points, so carousels and full-screen sections come to rest neatly on an item.

Sticky header

A top bar that stays pinned to the top of the screen while the page scrolls underneath it, so navigation is always one click away.

Ease-in-out

An easing curve that starts slowly, speeds up in the middle, and slows down again at the end, tracing an S shape on a graph.

Reduced motion

An operating system setting that asks apps to minimize movement, which websites detect with the prefers-reduced-motion media query.