Sticky Navbar with Scroll Offset Demo

This demo shows a way to cope with the absence of Scroll offset when the navbar is not Fixed (here it's Sticky), by using a dummy div with an offset declared as a top negative margin equal of the height of the Navbar. The ID is then declared on the dummy div instead of the section.

(Hey, by the way, I'm a sticky element!)

This is the Sky section

(Hey, by the way, I'm a sticky element!)

This is the Tomato section

(Hey, by the way, I'm a sticky element!)

This is the Marine section

(Hey, by the way, I'm a sticky element!)