I have one page, and ONE page only, of HTML with different sections of anchors when scrolling instead of bringing a user to another page( similar to this video Smooth Scrolling with Sticky Header Menu via HTML CSS only | Page Scroll via Sticky Navbar Menu - YouTube)
- The only difference between my webpage and this videos webpage mentioned above, is that once I add id=“about” in the
<h1>
element and then also link the anchors href="#about" it WONT scroll smoothly to the about section. Instead it abruptly shows up at the about section. I tried adding:
html {
scroll-behavior: smooth;
}
// or
* {
scroll-behavior: smooth;
}
(but no luck…any help on this?)