TIL: Smooth scroll behaviour with CSS

I was aware that the scrolling behaviour of browsers can be adjusted with JavaScript. Today I learned that it’s also possible to do with CSS:

.container {
    scroll-behaviour: smooth;
}

Sadly it’s not available in all browsers, Internet Explorer, Safari and Opera do not support it.

Check out the CSS Tricks article about the scroll-behaviour property.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *