1

Sorry for the big title, but I made a spinning animation with a image using css, so when I hover my mouse over it, the image spins. The thing is, I wanted it to not reset when I'm not hovering anymore.

HTML:
<img src="dieimg.png" class="die" width="50" height="50" id="die">

CSS:
@keyframes spin {
  from {transform:rotate(0deg);}
  to {transform:rotate(360deg);}
}
.die:hover {
  -webkit-backface-visibility: hidden;
  animation: 1s spin;
}
.die {
  -webkit-backface-visibility: hidden;
}

I'm new to JavaScript (and to html and css as well, but not as much) and I would appreciate if you could give me something so I can understand the code better, as well as the code for it.

Night
  • 61
  • 5

0 Answers0