I'm trying to set a custom color for the active state of a bootstrap button.
HTML:
<button class="btn btn-lg btn-primary" id="addToCart" data-value={{food.name}}>Add to cart</button>
CSS:
.btn-primary {
color: #FFFFFF;
background-color: #43A047;
border-color: #43A047;
}
.btn-primary:active,
.btn-primary.active {
background-color: #43A047;
}
.btn-primary:hover {
color: #43a047;
background-color: #FFFFFF;
border-color: #43a047;
}
With this code I'm able to change the color and the hover color of the button, but when I click the button the default btn-primary color remains. What am I doing wrong here?