I have been attempting to modify the link color on the nav-bar, but despite making changes, it appears unchanged. What could be causing this issue? Here is the code snippet:
<nav class="navbar navbar-expand-lg navbar-dark bg-primary fixed-top" id="sideNav">
<a class="navbar-brand" href="#page-top">
<span class="d-block d-lg-none">Start Bootstrap</span>
<span class="d-none d-lg-block">
<img class="img-fluid img-profile rounded-circle mx-auto mb-2" src="img/profile.jpg" alt="">
</span>
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="#about">About</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#experience">Experience</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#education">Education</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#skills">Skills</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#interests">Interests</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#awards">Awards</a>
</li>
</ul>
</div>
</nav>
CSS
.bg-primary {
background-color: #BD5D38 !important;
}
,
.nav-link {
color: #222222 !important;
}
.nav-link:hover,
.nav-link:focus,
.nav-link:active {
color: #ffffff;
}
#sideNav .navbar-nav .nav-item .nav-link {
font-weight: 600;
text-transform: uppercase;
}
@media (min-width: 992px) {
#sideNav {
text-align: center;
position: fixed;
top: 0;
left: 0;
display: flex;
flex-direction: column;
width: 17rem;
height: 100vh;
}
#sideNav .navbar-brand {
display: flex;
margin: auto auto 0;
padding: 0.5rem;
}
#sideNav .navbar-brand .img-profile {
max-width: 10rem;
max-height: 10rem;
border: 0.5rem solid rgba(255, 255, 255, 0.2);
}
#sideNav .navbar-collapse {
display: flex;
align-items: flex-start;
flex-grow: 0;
width: 100%;
margin-bottom: auto;
}
#sideNav .navbar-collapse .navbar-nav {
flex-direction: column;
width: 100%;
}
#sideNav .navbar-collapse .navbar-nav .nav-item {
display: block;
}
#sideNav .navbar-collapse .navbar-nav .nav-item .nav-link {
display: block;
}
}
Despite modifying the .nav-link class, the change is not reflecting. The nav-link class is within the a tag. I prefer not to use a tags for specifying hover and link colors as other links on my site will have unique colors while only nav-links should have this specified color. Hence, I am attempting to utilize the nav-link class for this purpose. How can I resolve this issue? Thanks in advance!