Anchor link jumps to section ID directly, how to enable smooth scrolling?

Hi, I’ve been trying for hours to find out how to have smoother scrolling for my anchor links. The links are working fine but it just jumps directly to it. I’m trying to have the anchor links scroll more smoothly to the specific sections of the long article. Can anyone advise what to do?

Here’s a recording of the issue on loom: Loom recording


Here is my site in Read-Only: Read only link site here

Have you checked to see if there’s any custom code added in the site settings panel?

I checked the page settings and typically it’s controlled through this method, by adding an attribute to the body element but I’m not seeing anything there.

Try publishing it to staging as well and check there, the Webflow preview does not always show the exact behavior of the published site.

Thanks for checking in! There shouldn’t be any custom attribute because I don’t really know how to do it. :sweat_smile: I tried publishing too, but it’s the same.

What’s the published site link?

Hi @memetican The site link is here!

Not sure why it’s not happening automatically, typically Webflow’s section links are setup to smooth scroll.

However you can add some CSS to your page or site <head>;

<style>
  html {
    scroll-behavior: smooth;   
  }
</style>
2 Likes

@memetican Thanks so much for the custom code! That resolved the issue. :slightly_smiling_face:

2 Likes