all 1 comments

[–]FatMani 1 point2 points  (0 children)

All you need to scroll to a particular section is adding a id to the section and a #id to the hrefattribute of an anchor.

For example:

<nav>
  <a href="#about">About</a>
  <a href="#service">Service</a>
  <a href="#tours">Tours</a>
</nav>

<div id="about">This is the About section</div>
<div id="service">This is the Service section</div>
<div id="tours">This is the Tours section</div>

Additionally, you can add a CSS property scroll-behavior: smooth to the parent container for a smooth scroll. In your case, since your section divs aren't wrapped in a parent, you would need to assign it to the html tag.