I'm trying to remove those small gaps between my nav-link
elements and navbar
on the bottom as well as on the right side, but can't seem to figure out. I tried setting min-height: 0
and changing it to display: flex
and tweaking the justify-content
and align-items
properties, but didn't achieve the desired outcome. How else could I make it work?
Here is my code:
header {
display: flex;
position: fixed;
top: 0;
left: 0;
width: 100%;
}
#logo-container {
width: 50%;
text-align: left;
background-color: lightblue;
}
#navbar {
font-size: 1.4em;
width: 50%;
text-align: right;
background-color: orange;
padding: 10px 0px 10px 0px;
}
.nav-link {
padding: 10px;
text-decoration: none;
background-color: green;
}
.nav-link:hover {
background-color: gray;
}
<header>
<div id="logo-container"></div>
<nav id="navbar">
<a class="nav-link" href="#welcome-section">About</a>
<a class="nav-link" href="#projects">Projects</a>
<a class="nav-link" href="#contact">Contact</a>
</nav>
</header>