How to Add a “Back to Top” Button in Webflow
Learn how to add a “Back to top” button in Webflow that appears as you scroll, using a lightweight JavaScript script.
In this tutorial, Sandro, cofounder of Gemeos Webflow agency, shows you how to add a “Back to top” button that appears on scroll in Webflow.
Example
1. Create the button in Webflow
Add a Link Block or Div element to your page. Give it the back-to-top class. Set its position to Fixed, bottom: 24px, right: 24px. Set it to display: none by default. Add an arrow icon or whatever text you want inside it.
2. Add the link to the top of the page
If you’re using a Link Block, set the link to # or to the ID of your hero section.
3. Add this script in the <body>
4. Publish and test
The button appears after 300px of scrolling and smoothly scrolls back to the top on click. Adjust the 300 value based on how long your pages are.
Conclusion
A back to top button improves the experience on long pages. Use cases:
- Blog pages with long articles
- Landing pages with lots of sections
- FAQ pages with many entries
Lorem ipsum
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.















