如何使用平铺中的重复图像填充网站,就像background-repeat: repeat;
使用 CSS 或 Javascript 使其旋转一样?
要旋转单个图像,我可以使用 CSS:
@-webkit-keyframes spin {
from { -webkit-transform: rotate(0deg); }
to { -webkit-transform: rotate(360deg); }
}
@-moz-keyframes spin {
from { -moz-transform: rotate(0deg); }
to { -moz-transform: rotate(360deg); }
}
@-ms-keyframes spin {
from { -ms-transform: rotate(0deg); }
to { -ms-transform: rotate(360deg); }
}
img#id {
-webkit-animation-name: spin;
-webkit-animation-duration: 5s;
-webkit-animation-iteration-count: infinite;
-webkit-animation-timing-function: linear;
-moz-animation-name: spin;
-moz-animation-duration: 5s;
-moz-animation-iteration-count: infinite;
-moz-animation-timing-function: linear;
-ms-animation-name: spin;
-ms-animation-duration: 5s;
-ms-animation-iteration-count: infinite;
-ms-animation-timing-function: linear;
}
但是我不知道如何对重复的图像执行此操作,即访问背景图像作为元素或重复 a<img>
并用给定的图像填充整个页面,例如background-repeat
.
这是旋转单个图像的示例。