Step 1: Define a class named applycolor
which can be used to apply the color you choose.
Step 2: Define what actions happens to it when it hovers. If your form background is white, then you must make sure that on hover the tab does not turn white. To achieve this use the !important
clause to force this feature on hover property. We are doing this to override Bootstrap's default behavior.
Step 3: Apply the class to the Tabs which you are targetting.
CSS section:
<style>
.nav-pills > li.active > a, .nav-pills > li.active > a:hover, .nav-pills > li.active > a:focus {
color: #fff;
background-color: #337ab7 !important;
}
.nav > li > a:hover, .nav > li > a:focus {
text-decoration: none;
background-color: none !important;
}
.applycolor {
background-color: #efefef;
text-decoration: none;
color: #fff;
}
.applycolor:hover {
background-color: #337ab7;
text-decoration: none;
color: #fff;
}
</style>
Tab Section :
<section class="form-toolbar row">
<div class="form-title col-sm-12" id="tabs">
<ul class="nav nav-pills nav-justified">
<li class="applycolor"><a data-toggle="pill" href="#instance" style="font-size: 1.8rem; font-weight: 800;">My Apps</a></li>
<li class="active applycolor"><a data-toggle="pill" href="#application" style="font-size: 1.8rem; font-weight: 800;">Apps Collection</a></li>
</ul>
</div>
</section>