Adding smooth scrolling to a page used in a single CSS declaration! First, get your HTML set up with your navigation href pointing to IDs throughout the page.
Then drop-in scroll-behavior smooth in the CSS and boom!
HTML
<!-- Anchor tag --> <a href="#scrollme">Scroll Me To</a> <!-- Section at the bottom of the page --> <section id="scrollme">I'm Here Smooth Scrolling</section>
CSS
html {
scroll-behavior: smooth;
}
Comments
Post a Comment