【发布时间】:2021-09-27 07:24:47
【问题描述】:
我正在尝试创建幻灯片作为背景,但它在 Firefox 中不起作用。图像发生变化,但没有指定的过渡。
.main-page {
width: 100%;
height: 100vh;
animation: animate 15s ease-in-out infinite;
-webkit-animation: animate 15s ease-in-out infinite;
-moz-animation: animate 15s ease-in-out infinite;
box-shadow: inset 0 0 0 2000px rgba(0, 0, 0, 0.5);
background-size: cover;
}
@keyframes animate {
0%,
100% {
background-image: url(/img/001.jpg);
}
50% {
background-image: url(/img/002.jpg);
}
}
检查检查器,我可以看到以下内容处于活动状态:
-webkit-animation: animate 15s ease-in-out infinite;
我做错了什么?
谢谢。
【问题讨论】:
-
您好,我不清楚您期待什么过渡。你想让图像淡入淡出吗?
-
是的,图像应该淡入/淡出。它在 chrome 中工作。
标签: html css animation firefox