Currently, I am attempting to create a header that has a freezing effect. My goal is to have a banner at the top with a navigation menu underneath it. When scrolling down, I want the banner to disappear but have the navigation menu remain frozen at the top of the page. I have been struggling to achieve this using the position: fixed
property since I need the element below it to freeze as well. In summary, my current layout looks like this:
<div><img src="img"></div>
<nav>...</nav>
The desired outcome is for the banner to vanish when I scroll down, while the navigation menu stays locked at the top of the page, ensuring its visibility throughout.