i'm trying to change the color of class active in my html code. i'm creating nav sidebar. here's my code:
<div class="col-sm-2">
<ul class="nav nav-pills nav-stacked nav-static"> <!--stacked untuk jadi vertical -->
<li class="active"><a>Create Case</a></li>
<li><a href="wf-listofcase.php">List of cases</a></li>
<li><a href="linksofapps.html">Links of Apps</a></li>
</ul>
</div>
how to change its color? thanks before..
You can always modify your navigation list through css. Use this css code instead, in that way use you use the a tag to change the color and its background-color. It's improper to use the li tag to set the background only and a tag to set the color of the text.
Hence, the background color of an active nav-item can be changed in the following manner by changing the background-color CSS property. Example: html.
You can use . text-reset class to reset the color from default blue to anything you want.
You can use:
.active a{
color: red !important;
}
Or to avoid !important
, use:
.nav-pills > li.active > a{
color: red;
}
DEMO
The following code applies red color for all the anchor tags.
a {
color: red !important;
}
To apply the color only within the "nav-static" wrapper, use the following code.
.nav-static .active a{
color: red !important;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With