I have the following code:
button {
transition: all 3s;
}
button:link,
button:visited {
background-color: #51cf66;
}
button:hover,
button:active {
background-color: #000;
}
<div>
<h1>Hi there</h1>
<button>push me</button>
</div>
This code works as expected on Firefox. I can see the transition happening on the button when I am hovering in or hovering out.
On chrome, the animation only happens when I am hovering in. When I hover out, the button goes back to its original color immediately.
Do you guys have any idea about what I am doing wrong? What can I do to make sure hover out animation works on chrome and firefox, the same way?
Thanks.