@keyframes anim {
100%{transform: rotate(360deg)}
}
button {
animation-duration: 1200ms;
animation-iteration-count: 1;
}
button:hover {
animation-name: anim;
}
You just set the animation name to the spinning animation on hover. easy as that.