0

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>
shellz
  • 3
  • 1
  • If you are using jQuery, then this may be helpful: https://stackoverflow.com/questions/6677035/scroll-to-an-element-with-jquery – Anis R. Apr 16 '22 at 10:07
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – Community Apr 16 '22 at 10:09
  • In future you will be able to use scroll-behavior in CSS to do this but it’s not yet fully supported everywhere. For now there are various JS workarounds out there. E.g. https://www.w3schools.com/howto/tryit.asp?filename=tryhow_css_smooth_scroll_jquery – A Haworth Apr 16 '22 at 10:14

1 Answers1

2

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

adevinwild
  • 278
  • 4
  • 8