I have styled my active menu class with a border-bottom.
@media (min-width: 1040px) {
#rbc-navbar.navbar-default .navbar-nav > li.active {
border-bottom: 3px solid #56c7ff;
}
}
However, when hovering over other links, they appear to be at different heights because of the added border at the bottom.
Question: How can I ensure that all links in a bootstrap navbar, when a border bottom is added to one link, are at the same height?
View the Codepen Example here (Note: The code pen now has updated working code)
CSS Styles
#rbc-navbar.navbar-default .navbar-brand {
color: rgba(255, 255, 255, 1);
}
#rbc-navbar.navbar-default {
font-size: 16px;
background-color: rgba(22, 30, 44, 1);
border-bottom-width: 0px;
}
@media (min-width: 1040px) {
#rbc-navbar.navbar-default .navbar-nav > li.active {
border-bottom: 3px solid #56c7ff;
}
}
/* Other CSS styles omitted for brevity */
HTML Markup
<div id="rbc-navbar" class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="<?php echo base_url();?>">Riwaka Bowling Club</a>
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-menubuilder">
<i class="fa fa-bars" aria-hidden="true"></i>
</button>
</div>
<div class="collapse navbar-collapse navbar-menubuilder">
<ul class="nav navbar-nav navbar-left">
<li class="active"><a href="/">Home</a></li>
<li><a href="/about-us">About Us</a></li>
<li><a href="/contact">Contact Us</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="">Members Login <i class="fa fa-sign-in" aria-hidden="true"></i></a></li>
</ul>
</div>
</div>
</div>