Currently, I am working on programming a website and I am trying to create a navigation bar that stays fixed at the top while scrolling. I have attempted to achieve this using the following CSS:
h1 {
Position: fixed;
}
However, the above code is not producing the desired result for me. To see what I have so far, you can view the JSFiddle
I created here: https://jsfiddle.net/qayzbjo0/3/
I would greatly appreciate it if you could assist me with this issue. If you are able to find a solution, please update the code in the JSFiddle
and share the new URL with me. :)
Thank you in advance!
.navbar {
background-color: #60C8FF;
margin: 0px;
width: 100%;
border-bottom: 3px solid #36B9FF;
}
.navbar h1 {
padding: 5px;
border-bottom: none;
text-align: center;
}
.navbar li {
display: inline;
width: 100%;
}
.navbar ul {
text-align: center;
width: 100%;
position: fixed;
}
<body>
<div class="navbar">
<h1 class="navbar">NeurOp - Specialist in neurale oplossingen</h1>
<ul>
| <li>Home</li> |
<li>Neuraal Netwerk</li> |
<li>Toepassingen</li> |
<li>Over ons</li> |
</ul>
</div>
<div class="home">
<p>AAP<br>AAP<br>AAP<br>AAP<br>AAP<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br>HOI<br></p>
</div>
<!-- Download terms and conditions in PDF file in the footer -->
</body>