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

General Discussion

Sticky Nav - Smooth Scrolling Offset?

There was a bit of chatter concerning this back in 2018, but we're now at the end of 2019, and I'm curious if Bootstrap 4 (or the upcoming 5) has any proper implementations to address this increasingly common scenario.

That scenario, is setting scroll-behavior: smooth; When clicking a link, the page in the demo site currently jumps instantly, which isn't everyone's first choice in behavior. When set to smooth, the fixed header obscures the view of where the browsers scrolls to, though it is doing its job correctly.

That said, with all of the "make your life easier" talk bootstrap is constantly throwing our way, I'd love to see a quick and easy solution for this. If we're able to convey an offset when scrolling to let navigation know when to change, is that not a 2-way street to do the same with clicking said navigation and going to the desired spot?

I know people have JavaScript solutions to this, as well as a plethora of CSS-only hacks (with mixed results), so what's the Bootstrap solution to this rather common scenario? If there isn't one, can someone explain in full why this simply isn't possible? (not language I tend to believe in when working with code, there's ALWAYS a way).