正时针旋转

img {
  animation: rotate 2s linear infinite;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

逆时针旋转

img {
  animation: rotate 2s linear infinite;
}

@keyframes rotate {
  from {
    transform: rotate(360deg);
  }
  to {
    transform: rotate(0deg);
  }
}

顺时针旋转45度

img{
  transform: rotate(45deg);
}

逆时针旋转45度

img{
 transform: rotate(-45deg);
}