I am attempting to modify the color of a bootstrap 5 btn-outline-primary
button. You can view an example at https://jsfiddle.net/nct2dpvf/17/.
- In the provided example, the standard button (with the class
btn-outline-primary
) does not change color on hover, despite the functionality seen in the example at https://getbootstrap.com/docs/5.0/forms/checks-radios/#outlined-styles. I am following the same structure and using the same classes. - The button that has been recolored to red (using custom CSS class
btn-red
) behaves correctly on hover, but does not change color when clicked (unlike the standard Outline button). - When I combine both classes
btn-red
andbtn-outline-primary
, hovering works as intended, but the background turns blue when clicked on.
Is there a way to enable hover functionality for the standard button (btn-outline-primary
) and have it change to red when clicked, like the red button (btn-outline-danger
)?