Reputation: 29
I have an SVG with 3 paths but only needed em to rotate continually. This worked well on an SVG with one path but not with this one and I got a few others that I could like to rotate on a fixed position. Here is the source code with preview!
.rotate {
animation: rotation 8s infinite linear;
}
@keyframes rotation {
from {
transform: rotate(0deg);
}
to {
transform: rotate(359deg);
}
}
Upvotes: 2
Views: 2328
Reputation: 126
you can transform the rotation origin, the default origin is the upper left corner. to rotate a item around its center you have to transform the origin.
.rotate {
transform-origin: 50% 50%;
animation: rotation 8s infinite linear;
}
Upvotes: 2