Expected result: the active link has a black bottom border. when hovering over links (not including the active page) the bottom bar is shown with a different color.
Actual result: the black bottom border appears under the active page link, but when hovering over the link it remains and a second, colored bottom border appears.
I was using similar code to control background color and it worked fine. But when I switched to trying to use bottom-border, I got an unexpected result -
Two bottom borders appear, one black and one colored.
ul.topnav li a {
display: block;
color: black;
text-align: center;
padding: 14px 16px;
text-decoration: none;
border-bottom: 2px solid transparent
}
ul.topnav li a:hover:not(.active) {
border-bottom: 2px solid #61a5c2;
}
ul.topnav li.active {
border-bottom: 2px solid black
}
<header>
<nav>
<ul class="topnav">
<li class="active"><a href="#">Home</a></li>
<li class=""><a href="#">Diagnosis</a></li>
<li class=""><a href="#">Data Visualization</a></li>
<li class="right"><a href="#">About</a></li>
</ul>
</nav>
</header>