【发布时间】:2018-08-19 09:11:34
【问题描述】:
背景应该是不同图像的自动幻灯片。但是,当它转换到下一个图像时,会出现白色闪光/轻弹。难道我做错了什么?我在 css 中使用关键帧
html,body{
animation-name: rainbowtext;
animation-duration: 35s;
animation-timing-function: ease-in;
animation-iteration-count: infinite;
}
@keyframes rainbowtext{
0%{
background-image: url("diet-soda.jpg");
background-size: cover;
background-repeat: no-repeat;
height: 100%;
}
25%{
background-image: url("coke.jpeg");
background-size: cover;
background-repeat: no-repeat;
height: 100%;
}
50%{
background-image: url("diet-soda2.jpg");
background-size: cover;
background-repeat: no-repeat;
height: 100%;
}
75%{
background-image: url("soda2.jpg");
background-size: cover;
background-repeat: no-repeat;
height: 100%;
}
100%{
background-image: url("sugar.jpeg");
background-size: cover;
background-repeat: no-repeat;
height: 100%;
}
}
【问题讨论】:
-
只是因为图片没有加载所以在第一次迭代时会出现这种情况,然后就会消失
标签: html css css-animations slideshow keyframe