Hi I am trying to remove the white space between the navigational bar and header. However, the margin and padding are already set to 0 for the body, and i've done it for the whole document (*). Furthermore, I am trying to make the navigational bar sticky. And scroll and stay at the top of the document once you scroll past the initial top: 0. I've followed tutorials online but it didnt work...
The website I am trying to have it created like it Mineplex.com the popular Minecraft website. But for some reason white space is between the header and navigational bar as well as that the navigational bar is not remaining sticky.
Can someone please help or point me in the right direction as I am extremely confused.
body {
height: 5048px;
/* background-color: #f1f1f1; */
padding: 0;
margin: 0;
}
.header--main {
height: 300px;
background-color: purple;
}
nav {
width: 100%;
height: 50px;
/* background-image: linear-gradient(to bottom, #4c45b2, #25accf);*/
background-color: red;
position: -webkit-sticky;
top: 0;
}
nav ul {
text-align: center;
list-style-type: none;
}
nav ul li {
display: inline-block;
}
nav ul li a {
text-decoration: none;
display: block;
padding: 14px 28px;
font-size: 16px;
color: white;
font-weight: bold;
font-family: 'Open Sans', sans-serif;
}
nav ul li a:active {
background-color: white;
color: #484848;
}
nav ul li a:hover {
background-color: white;
color: #484848;
}
/*Make navbar font to open sans*/
<header>
<div class="header--main">
</div>
<nav class="sticky">
<ul>
<li><a href=”./index.html”>Home</a></li>
<li><a href=”#”>Registration</a> </li>
<li> <a href=”#”>Order</a></li>
<li> <a href=”#”>Features</a></li>
</ul>
</nav>
</header>
<article>
<section>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</section>
</article>