Home > Software design >  How to make the navigation inside the page smother?
How to make the navigation inside the page smother?

Time:06-10

I'm using the navigation with the anchor, like: <a href="#teste"> <div id="teste"></div>; But when I click on the link, it's too fast, I wanna to this be more smoth. There's a way to do this only in html, or whitout Jquery?

CodePudding user response:

So you want it to smoothly scroll to that div? Heres a code snippet to help. Use the css scroll-behavior property with smooth as its value.

* {scroll-behavior: smooth;}
<a href="#teste">Go to #teste </a>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<div id="teste"> #teste</div>

  • Related