Memberstack
Pricing
API
Login
Build for free
Memberstack
Pricing
API
Login
Build for free
Memberstack
Pricing
API
Login
Build for free
Blog/How to Make Section/Anchor Scrolling Work with your Sticky/Fixed Navbar

How to Make Section/Anchor Scrolling Work with your Sticky/Fixed Navbar

This post will teach you how to make section scrolling work properly with your sticky navbar, why fixed navigation can interfere with anchor links, and how to implement a smooth solution in your Webflow site.

Ovidiu·Contributor
|
December 16, 2024·2 min read

How to make section/anchor scrolling work with your sticky/fixed navbar

Memberscripts needed:

  1. https://www.memberstack.com/scripts/anchor-link-offset

Tutorial:

Cloneable:

__wf_reserved_inherit
__wf_reserved_inherit
__wf_reserved_inherit
__wf_reserved_inherit

Why/Use Cases

- Improve UX by lining up the top of the section you’re linking to with the bottom of the navigation bar so they don’t overlap.

Make section/anchor scrolling work with a sticky/fixed navbar on a Webflow site

If you’ve ever used anchor links with a sticky or a fixed navigation bar, you’ve probably noticed that the website will by default line up the very top of the section you’re linking to with the top of your viewport. This means that the navigation bar will then overlap with the top of the section, thus hiding the beginning of the content in that section.

Thankfully, there’s an easy fix for this and we’re going to tell you all about it below.

To make section/anchor scrolling work with a sticky or fixed navbar on your Webflow site, we’re going to use MemberScript #138 – Anchor Link Scroll Offset. Follow the link to get the code you’ll need to add to your page and watch a video tutorial on how to set everything up.

Setting it up

All you need to do on the site is add the following attribute to your navigation bar:

· ms-code-scroll-offset=”20”

With a value of 0, it will calculate the height of the navigation bar and offset the anchor point by that exact same number of pixels. However, that might not look too good, which is why we went with 20 – this will offset it just a bit more so it looks nice. You can use whatever value works for you.

Making it work

Now that you’ve got everything set up in Webflow, all you need to do is add the MemberScript #138 custom code to your page, before the closing body tag.

Conclusion

That’s everything, you can now go ahead and test the country detection on your live site.

If you want to use our demo project to get you started, just click the button below to add it to your Webflow site.

Our demo can help you make section/anchor scrolling work with a sticky/fixed navbar on a Webflow site.

Take me to Cloneable!

Written by

Ovidiu

Contributor

Contents

  • Memberscripts needed:
  • Tutorial:
  • Cloneable:
  • Why/Use Cases
  • Make section/anchor scrolling work with a sticky/fixed navbar on a Webflow site
  • Setting it up
  • Making it work
  • Conclusion
  • Take me to Cloneable!

Share

Explore Memberstack

  • All Features
  • Customer Showcase
  • Templates
  • Find Experts
  • Pricing
  • Help Center

Product

  • Full Feature List
  • User Accounts
  • Gated Content
  • Secure Payments
  • API & Integrations
  • Data Tables
  • Memberstack & Webflow
  • Memberstack & Claude Code
  • Memberstack & WordPress
  • Create a new account
  • 2.0 Log in
  • 1.0 Log in
  • Pricing

Learn about Memberstack

  • Showcase
  • Testimonials
  • Why Memberstack
  • Memberstack vs Outseta
  • Memberstack vs Memberspace
  • Memberstack vs Webflow Memberships

Company

  • About
  • Careers
  • Changelog
  • Partnerships(email)
  • Contact Us(email)
  • X
  • LinkedIn
  • "Do Not Sell My Data" Promise

Resources

  • Vibe Coding
  • Templates
  • Components
  • MemberScripts
  • Data Attributes
  • Find Experts
  • Hiring Guide
  • Webflow Slack Community
  • WordPress Slack Community
  • Support Forum
  • Help Center
  • Blog
  • llms.txt (for AI)
  • llms-full.txt (for AI)
AICPA
SOC

SOC 2 TYPE 1

CERTIFIED

GDPR

COMPLIANT

CCPA

COMPLIANT

Privacy PolicyTerms of ServiceCookie PolicySecurity Policy

© Memberstack Inc. 2018 - 2025. All rights reserved.

Memberstack - The no-code membership platform for any website | Product Hunt