gpt4 book ai didi

CSS背景图片旋转

转载 作者:行者123 更新时间:2023-11-28 13:08:41 25 4
gpt4 key购买 nike

我正在制作旋转容器。其实我已经做了..但是有问题:背景图片加载了一半(容器加载了一半)。

代码是:

  @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;
}

提前致谢!

最佳答案

问题是height:100%

我将 div“.ornament”的高度(通过 chrome 检查器)更改为背景图像的实际高度 (1386px),它工作正常。

关于CSS背景图片旋转,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19525599/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com