Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How do I animate switching to different sections in html?

I recently started using sections for my website but I hate how it just immidiately just takes you to the section you’ve set it to go. I’ve seen on some websites that when you press a button to take you to another section, it slides down going down really smooth. I’ve been searching on google but didn’t find what I need. Even checked the code on inspect element but yet didn’t find anything related to what I need.

<p><a href="#haid">🡣</p>
<p id="haid" class="about text-black text-size-big">How am I doing?</p>

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

The effect you are looking for is related to scroll behavior in css

CSS

html {
  scroll-behavior:smooth;
}

Source :
https://developer.mozilla.org/fr/docs/Web/CSS/scroll-behavior

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading