It s a fresh, new week. And maybe I m totally done.
But I created a new test site and added a fixed navigation and
some sections within the page.
I created anchor links and when I publish the site and click on one of the
navbar links, there is no smooth scrolling animation to the corresponding anchor.
Is it just me _ what am I missing?
p.s. Is there still a legit workaround to have the navbar stop at the section itself UNDER the navigation bar
instead of scrolling over it and hiding the first content element?
Name your sections “one” “two” “three” instead of “1” “2” “3”. In other words don’t name anything with digits first, caps, dashes, spaces etc HTML tags and names, to avoid issues with browsers, JS, CSS etc…
Snap to the bottom of the Nav
It’s not a workaround. If you have a header, sections will stick underneath, if you have a Nav separated from the header, it will stick underneath. i don’t know why yours bugs, I removed it, put a new one, give it fixed pos, 100% width and it works as expected. You’d need to check the “Disable scroll offset…” checkbox in order to behave differently, actually.
I also forgot to set a width and height to the navbar example. Therefore it could not calculate the offset needed to be positioned before the corresponding section.
Don’t be so hard on yourself, we’re so close to the breakfast still
And I have to say, the “header and/or nav” rule is only clear to me since yesterday, thanks to @cyberdave who took the time to craft a definitive example about it.