How to make a back-to-top button using CSS and HTML only?

What you would want to do is put an “anchor” at the top of the page, using an <a> tag (it’s not JUST useful for links!). Then, when you have a link that goes to #nameofanchor, it scrolls to the anchor with that name. You’d do it like this:

<a id="top"></a>
<!--content here-->
<a href="#top">Back to top</a>

Here is a working jsfiddle: http://jsfiddle.net/qf0m9arp/1/

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)