我正在制作旋转容器。其实我已经做了..但是有一个问题:背景图像加载了一半(容器加载了一半)。
代码是:
@keyframes rotate-ornament {
from {
-webkit-transform: rotate(0deg);
}
to {
-webkit-transform: rotate(360deg);
}
}
@-webkit-keyframes rotate-ornament {
from {
-webkit-transform: rotate(0deg);
}
to {
-webkit-transform: rotate(360deg);
}
}
@-moz-keyframes rotate-ornament {
from {
-webkit-transform: rotate(0deg);
}
to {
-webkit-transform: rotate(360deg);
}
}
@-ms-keyframes rotate-ornament {
from {
-webkit-transform: rotate(0deg);
}
to {
-webkit-transform: rotate(360deg);
}
}
.ornament {
position:absolute;
top:0;
left:0;
right:0;
bottom:0;
width:100%;
height:100%;
display:block;
z-index: -1;
}
.ornament {
background:transparent url('images/ornament.png') no-repeat;
background-size: 100%;
z-index: -1;
-moz-animation: rotate-ornament 100s linear infinite;
-ms-animation: rotate-ornament 100s linear infinite;
-o-animation: rotate-ornament 100s linear infinite;
-webkit-animation: rotate-ornament 100s linear infinite;
animation: rotate-ornament 100s linear infinite;
}
提前致谢!