The other day I made a post about a
On this specific post, I got a lot of comments; you can do the same in just plain
HTML. This is true! And I thought it would be great to write an article about this.
HTML Structure permalink
<a href="#top" class="scroll scroll-top">☝️</a>
<a href="#bottom" class="scroll scroll-bottom">👇</a>
All the content...
So the thinks to mark are the divs with specific id's, in this case we just made two empty divs, but we can even use existing divs!
Then we create two links with a
#top (id="top") and
This will automatically scroll to the specific ID once clicked on!
To make it smooth, we can add the following
It can be as easy as this, many ways leading to the same solution it all depends on what you prefer or needs.
See it in action on this Codepen.