https://i.sstatic.net/cV3X6.png
Seeking advice on adding a transition effect to my navbar. Specifically, I'd like to have a colored background appear below each link when hovered over. For example, when hovering over "HOME," a yellow color should display, and it should disappear when hovering over another link that triggers a different color. Any suggestions on how to achieve this effect?
Below is the HTML code:
<nav class="navbar navbar-default navbar-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#nav-collapse">
<span class="icon-bar" ></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<img class="img-responsive" src="images/brandz.png" >
</div>
<div class="collapse navbar-collapse" id="nav-collapse">
<ul class="nav navbar-nav">
<li><a href="#">Students</a></li>
<li><a href="#">Faculty</a></li>
<li><a href="#">About us</a></li>
<li><a href="#">Contact us</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a data-toggle="modal" href="#myModal"><span class="glyphicon glyphicon-log-in"></span> Login</a></li>
<!-- Modal -->
<div id="myModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<img src="images/logo.png" class="logo">
</div>
<div class="modal-body">
<p>Some text in the modal.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</ul>
</div>
</div>
</nav>
Here is the associated CSS code:
.navbar-default .navbar-nav > li > a {
font-weight: 300;
color: #949494;
display: block;
padding: 3px 20px 5px 60px;
border-bottom: 3px solid transparent;
line-height: 97px;
}
.navbar-default{
background-color:#fff;
}
.nav>li>a {
position: relative;
}
.navbar-default .navbar-right > li > a {
padding-left: 70px;
padding-right: 1px;
}
.navbar-default .navbar-toggle .icon-bar {
background-color: #000000;
margin:0 0 4px;
width: 25px;
height: 5px;
}
@media (max-width: 768px) {
.img-responsive{
width: 300px;
height:50px;
padding-left:50px;
}
}
@media (max-width: 376px) {
.img-responsive{
width: 220px;
height:50px;
padding-left: 20px;
}
}
@media (max-width: 286px) {
.img-responsive{
width: 180px;
height:50px;
padding-left: 5px;
}
}