I am attempting to add a background color to the active state of the Nav Pill. Here is the HTML and CSS code I am using:
.nav-pills > .nav-item > .nav-link:active{
background: red!important;
color: white!important;
}
.nav-pills > .nav-item > .nav-link:hover {
background-color: green!important;
color:white !important;
box-shadow: 1px 1px!important;
}
.nav-pills .nav-link {
color: #46b3e6;
border: 2px solid #eee;
margin-left: 10px;
box-shadow: 2px 2px;
}
Here is the corresponding HTML:
<ul class="nav nav-pills justify-content-center">
<li class="nav-item">
<a class="nav-link" href="all_patients.php">All Patients</a>
</li>
<li class="nav-item">
<a class="nav-link" href="all_patients.php?action=vacant_bedspaces">Vacant Bedspaces</a>
</li>
<li class="nav-item">
<a class="nav-link" href="all_patients.php?action=free_patients">Discharged Patients</a>
</li>
</ul>
Could it be because all my links have the same base (all_patients.php)?