.button. active

.button {
     background-color: orange;
     color: white;
 .button:hover {  
     background-color: black;
 .button:active {
     background-color: white;

I have this in my project. I see no color white. Then I changed the white to a green, and it was different when I clicked on it. Apparently, the way that I have it programmed, the .button.active stays up on the button for like an instant, and then returns to hover. It was my understanding that .button:active was about the button remaining the color, in this case white, for as long as some other button is not clicked. I must be missing some other code or forgot a timer or something. Do you know what it is that I am failing to code that would make the .button:active color remain white (in this case)?

Maybe this will help explain the :active pseudo-class.

1 Like