css连续旋转
While building the React Handbook landing page, I had to search how to rotate an image. I wanted to rotate an SVG image, but this works for any image type. Or any HTML element, actually.
在构建React Handbook登陆页面时,我不得不搜索如何旋转图像。 我想旋转SVG图像,但这适用于任何图像类型。 实际上是任何HTML元素。
Add this CSS instruction to the element you want to rotate:
将此CSS指令添加到要旋转的元素中:
animation: rotation 2s infinite linear;
You can also choose to add a rotate
class to an element, instead of targeting it directly:
您还可以选择将rotate
类添加到元素,而不是直接定位它: