I have a button that I want to rotate when the mouse hovers over it. However, while the spinning works when the mouse enters, it also spins when the mouse leaves. Here is what I mean:
button {
transition: transform 1.2s linear;
}
button:hover {
transform: rotate(360deg);
}
<button>X</button>
Is there any way to just make the mouse spin when the mouse enters?