【发布时间】:2021-11-03 16:31:24
【问题描述】:
您好,我有一张带有背景图片的图片,我只需要为背景制作旋转动画,但动画适用于它们。
这是我的 CSS 代码:
.to-rotate .img{
-webkit-animation-name: rotate;
-webkit-animation-duration:6s;
-webkit-animation-iteration-count:infinite;
-webkit-animation-timing-function:linear;
-moz-animation-name: rotate;
-moz-animation-duration:2s;
-moz-animation-iteration-count:infinite;
-moz-animation-timing-function:linear;
}
@-webkit-keyframes rotate {
from {-webkit-transform:rotate(0deg);}
to { -webkit-transform:rotate(360deg);}
}
@-moz-keyframes rotate {
from {-moz-transform:rotate(0deg);}
to { -moz-transform:rotate(360deg);}
}
【问题讨论】:
-
请显示相关的 HTML。在这种情况下,您可能可以使用伪元素,但必须有一些东西可以附加到它。
标签: css css-animations css-transitions