I have this code snippet at the beginning of my website:
<body> <div class="agile-main"> <div class="menu-wrap" id="style-1"> <nav class="top-nav">
<ul class="icon-list">
<li><a href="index.html"><i class="glyphicon glyphicon-home"></i> Home </a></li>
<li><a href="about.html"><i class="glyphicon glyphicon-info-sign"></i> About </a></li>
<li><a href="property.html"><i class="glyphicon glyphicon-briefcase"></i> properties </a></li>
<li><a href="agents.html"><i class="glyphicon glyphicon-eye-open"></i> Agents </a></li>
<li><a href="gallery.html"><i class="glyphicon glyphicon-picture"></i> Gallery</a></li>
<li><a class="active" href="contact.html"><i class="glyphicon glyphicon-envelope"></i> Contact </a></li>
</ul> </nav> <button class="close-button" id="close-button">C</button> </div> <div class="content-wrap"> <div class="header">
<div class="menu-icon">
<button class="menu-button" id="open-button">O</button>
</div>
<div class="logo">
<h2><a href="main.html">FE</a></h2>
</div>
<div class="clearfix"> </div> </div>
<div class="content"> Page content goes here </div>
</body>
I am trying to keep the navigation bar sticky, so that it remains at the top when the page is scrolled down. I've tried adding the style "overflow: hidden;position: fixed;top: 0; width: 100%;" to the nav tag, but it didn't work. I also tried applying it to other top div tags, but either the entire page freezes or the effect doesn't work. How can I successfully make the navbar sticky?
Thank you.