I'm trying to make the navbar follow the logo whenever the user scrolls down. Currently only the logo is fixed. When I try to make the header fixed instead of the header-img, both the logo and navbar disappeared. Any help would be greatly appreciated.
Another issue I have is that the logo resizes whenever I resize my window.
#header-img {
width: 3%;
height: auto;
position: fixed;
}
nav {
list-style-type: none;
position: relative;
left: 65px;
line-height: 60px;
font-size: 20px;
}
<div id="header">
<img id="header-img" src="https://cdn-0.idownloadblog.com/wp-content/uploads/2018/07/Apple-logo-black-and-white.png"></img>
<nav id="nav-bar">
<a class="nav-link" href="#mac">Mac</a>
<a class="nav-link" href="#ipad">iPad</a>
<a class="nav-link" href="#contactus">Contact Us</a>
<a class="nav-link" href="#support">Support</a>
</nav>
</div>
<div id="body">
<iframe id="video" width="1080" height="1920" src="https://www.youtube.com/watch?v=PSS889-qeJQ">
</iframe>
<h1 id="mac">Macs</h1>
<h1 id="ipad">iPads</h1>
<h1 id="contactus">Contact Us</h1>
<h1 id="support">Support</h1>
</div>