Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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.