I am trying to change the color of a class active in my html code. I am creating a navigation bar. here is 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 color? thanks before.
You can use:
.active a{ color: red !important; }
Or, to avoid !important , use:
!important
.nav-pills > li.active > a{ color: red; }
Demo
The following code applies red to all anchor tags.
a { color: red !important; }
To apply color only in the "nav-static" shell, use the following code.
.nav-static .active a{ color: red !important; }