How to make the navigation inside the page smother?

Issue

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?

Solution

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>

Answered By – JeffTheMasterr

Answer Checked By – Mary Flores (AngularFixing Volunteer)

Leave a Reply

Your email address will not be published.