Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript

Larisa Popescu
Larisa Popescu
20,242 Points

Data-offset changes the highlight in the navbar, but when you press the nav link, it still gets you past the heading.

When you press a nav link to #about section let's say, how do you do so it also moves before the heading?

2 Answers

Do you have some code that we can look at? If you have a WorkSpace that will be even better.

Larisa Popescu
Larisa Popescu
20,242 Points

I'm talking about Bootstrap 4 Basics course, the "Using ScrollSpy to Highlight Nav Links" video. The code is the same as in the video. And indeed, data-offset changes the highlighting of the links in the navbar, but when you actually press the links you still end up not seeing the headers of the sections. My question is what do I need to do, so the location it sends you to when you press the nav link starts before the headings.