0👍
The problem is that the :active property on a non clickable element will only trigger a onclick on and off effect. What you actually see. If you want to have a toggle effect you have two options:
- You actually use a clickable element to wrap your span such as a button
- You use javascript to change your class
function myFunction() {
var element = document.getElementById("myDIV");
element.classList.toggle("mystyle");
}
You must adapt this to your situation by attaching this kind of function to your click event.
Source:stackexchange.com