I am trying to create a menu
element that remains fixed at the top of the browser viewport as the user scrolls, ensuring it is always visible. In my webpage layout, the menu sits below some text in the header initially. Once the user scrolls past the header, I want the menu to become fixed to the top of the viewport, allowing it to remain visible. The menu should return to its original position when the user scrolls back up to reveal the header again.
Update: The design specifications require the menu to be positioned below the header to display an important message before the menu options. It should only become fixed at the top of the viewport after scrolling past the header.
I believe I may need JQuery to achieve this functionality. Can someone provide some examples or guidance on how to implement this?
<html>
<body>
<header id="header">Header text...
<menu id="menu"><a href="/">Home</a> | <a href="/Help">Help</a></menu>
</header>
<section id="more">More text...</section>
</body>
</html>