.img {animation: rotate_image 6s ease-in-out infinite;transform-origin: 50% 50%;} @keyframes rotate_image{ 100% { transform: rotate(360deg); } }