scroll-behavior
Specifies the scrolling behavior for a scrolling box, when scrolling happens due to navigation, CSSOM scrolling APIs, or scroll snapping operations not initiated by the user. 13.1. Smooth Scrolling: The scroll-behavior Property
Links about scroll-behavior
Fixing Smooth Scrolling & Page Search
Native smooth scrolling is one more example of standards paving the cow path by declaring a wide-spread practice officially a thing: being able to smoothly scroll the viewport to another part of a page without the user losing their orientation. As good at it is, though, it also has an undesired …
Code sample
/* Animate scrolling only if users don’t prefer reduced motion */
@media (prefers-reduced-motion: no-preference) {
html {
scroll-behavior: smooth;
}
}
Explore other pages
- aria-label
Defines a string value that labels the current element.
- svg
SVG is a language for describing two-dimensional graphics.
- :focus-visible
Applies if the user agent determines via heuristics that the focus should be made evident.
- ::marker
The ::marker pseudo-element represents the automatically generated marker box of a list item.