I'm trying to make a navigation with flexbox. Everything is fine until I hover over the space between my logo and my nav links. When I do this it turns my logo to the set hover state color. Which is what I want, but I don't want the space in between to affect the color of my logo (when I hover). This happens because I put a flex grow on my logo, to push my nav links to the right. How would I get around this? I'm not too familiar with other methods of doing so like using floats and display: block
. Any suggestions would help.
/*NAVIGATION-TOP SECTION*/
#nav {
display: flex;
position: fixed;
opacity: .5;
z-index: 2;
background: lightgrey;
padding: 20px 0 20px 0;
align-items: baseline;
width: 100%;
transition: .3s;
}
#logo {
flex-grow: 1;
z-index: 2;
padding: 0 0 0 50px;
font-size: 30px;
}
#logo:hover {
color: #00b0ff
}
.nav-links {
display: flex;
float: right;
padding: 0 25px 0 0;
}
.nav-links>a {
text-decoration: none;
color: black;
}
.nav-links>a:hover {
color: #00b0ff;
}
.nav-links>a>li {
list-style: none;
padding: 0 15px 0 15px;
}
<header>
<div id="nav">
<div id="logo">TECHNOLOGY CENTRAL</div>
<div class="nav-links">
<a href="#">
<li>Home</li>
</a>
<a href="#">
<li>About</li>
</a>
<a href="#">
<li>Services</li>
</a>
<a href="#">
<li>Contact</li>
</a>
</div>
</div>
</header>