MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/csshelp/comments/1812l6n/fixed_navbar_issue/
r/csshelp • u/[deleted] • Nov 22 '23
What is causing my fixed navbar when clicked to land in-between sections and not at the top of section?
here is the code- codepen
3 comments sorted by
2
you'll need a scroll margin on the element you're scrolling to https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-margin
2 u/[deleted] Nov 22 '23 Thanks man this help
Thanks man this help
You might want to add a functionality where the Navbar shrinks its height once it leaves the Hero page (pink Section).
or you may want to re-adjust the padding-top values to 200 px.
https://imgur.com/a/V5CULTv
2
u/tridd3r Nov 22 '23
you'll need a scroll margin on the element you're scrolling to https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-margin
2
u/[deleted] Nov 22 '23
You might want to add a functionality where the Navbar shrinks its height once it leaves the Hero page (pink Section).
or you may want to re-adjust the padding-top values to 200 px.
https://imgur.com/a/V5CULTv