Я видел много похожих проблем и ответов, но ни одного из них. решают мою проблему.
Код: Выделить всё
#centerDiv{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.rotation{
transform: rotate(0deg);
animation-play-state:paused;
}
.rotation:hover{
animation-name: rotation;
animation-duration: 1s;
animation-iteration-count: 1;
animation-direction:normal;
animation-play-state:running;
}
@keyframes rotation{
from{
transform: rotate(0deg);
}
to{
transform: rotate(-10deg);
}
}Код: Выделить всё
[img]https://dummyimage.com/200x200/aaaaaa/fff[/img]
Подробнее здесь: https://stackoverflow.com/questions/747 ... n-on-hover
Мобильная версия