Change class color active in bootstrap

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.

+6
source share
2 answers

You can use:

 .active a{ color: red !important; } 

Or, to avoid !important , use:

 .nav-pills > li.active > a{ color: red; } 

Demo

+7
source

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; } 
+4
source

All Articles