I want these buttons to be and stay active when clicked on but can't get it to work, and the "currentButton" to be active by default on page load. I am able to see the style for :active when I'm clicking on either button, but it doesn't stay active after clicking.
HTML for the 2 buttons:
<div class="w3-center invButtons">
<button class="w3-button currentButton">Current</button>
<button class="w3-button pastButton">Past</button>
</div>
CSS:
.w3-button{
border: 2px solid #555555;
background-color: white;
color: black;
padding: 4px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
width: 130px;
border-radius: 8px;
}
.invButtons {
padding-bottom: 16px;
margin: 30px 10px;
}
.w3-button:hover {
color:#000!important;
background-color: gray!important;
}
.w3-button:active {
color:yellow!important;
background-color: yellow!important;
}