Browser support is reasonably good. Key exceptions are: Safari, Internet Explorer and pre-2020 versions of Microsoft Edge.
If we’re linking between two sections on the same page, it can be nice to create a smooth scroll to that new section. Traditionally, this has always required Javascript.
Now, we can do this in pure CSS with the scroll-behavior
:
body {
scroll-behavior: smooth;
}
Adding this to your CSS will create a smooth transition for links that cause the user’s page to scroll: