Css smooth scroll speed It is because this CSS property is not compatible with a wide range of browsers. Still, it is not the preferred way to achieve smooth scrolling on the webpage. Although CSS solves the problem with just one line of code. See the Pen Apr 4, 2023 路 By default, we'll enable smooth scrolling via CSS, but then we’ll override that behavior for that button only. You can further manipulate the speed of the scrolling by adding a transition to the children elements within the container. Method #1 To achieve this, upon button click, we’ll first override the page’s scroll behavior by setting scroll-behavior: auto , and then after navigating to the top of the page, we’ll set it back to smooth . Smooth scroll in CSS allows users to effortlessly navigate between sections, improving the flow of information and retaining focus. Click Me to Smooth Scroll to Section 2 Below Note: Remove the scroll-behavior property to remove smooth scrolling. Wait, wait, what’s this scrolling box we speak of? May 21, 2025 路 The page jumps straight to the desired section when a link is clicked, which is an average user experience. . However, implementing smooth scroll in CSS can help eliminate the instant jump between sections. Apr 2, 2019 路 You can use CSS to apply scroll-behavior: smooth; to a container for which you would like a smooth scrolling behavior. May 29, 2025 路 Browser-compatibility of CSS Scroll Behavior. Jan 30, 2020 路 The scroll-behavior property in CSS allows us to define whether the scroll location of the browser jumps to a new location or smoothly animates the transition when a user clicks a link that targets an anchored position within a scrolling box. html { scroll-behavior: smooth; } Deeper Explanation. Here are the browsers supporting CSS scroll-behavior. Click on the link to see the "smooth" scrolling effect. aozrnf pmhgstkb wbup tvfsj egjtu gwba dzklayzk svxtw kxq pzfo