-2

This is what I want to do. An Image section on top before the navigation bar. After scrolling on the image section on top the navigation bar will stick on top. How can I do that?

See the Attached Photo for example

1 Answers1

0

Set the element to position: sticky and then give it the position you want it to stick at (top: 4rem, etc.). It will have relative position within its block, then and then will stick in position as the block is scrolled past.

John Meade
  • 142
  • 6