CSS动画在firefox和IE中不起作用

CSS动画在firefox和IE中不起作用,css,firefox,css-animations,Css,Firefox,Css Animations,动画标题图像在Firefox和IE中不起作用,而在chrome中则不是问题。我在动画css中添加了-moz 还有这个动画 @keyframes imag { 0% { background: url(images/1.jpg) no-repeat center center fixed; background-size: cover; } 20% { background: url(images/2.jpg) no-repeat center center fixed; back

动画标题图像在Firefox和IE中不起作用,而在chrome中则不是问题。我在动画css中添加了-moz

还有这个动画

@keyframes imag {
    0% { background: url(images/1.jpg) no-repeat center center fixed; background-size: cover; }
    20% { background: url(images/2.jpg) no-repeat center center fixed; background-size: cover; }
    40% { background: url(images/3.jpg) no-repeat center center fixed; background-size: cover; }
    60% { background: url(images/4.jpg) no-repeat center center fixed; background-size: cover; }
    80% { background: url(images/5.jpg) no-repeat center center fixed; background-size: cover; }
    100% { background: url(images/6.jpg) no-repeat center center fixed; background-size: cover; }
}
@-webkit-keyframes imag {
    0% { background: url(images/1.jpg) no-repeat center center fixed; background-size: cover; }
    20% { background: url(images/2.jpg) no-repeat center center fixed; background-size: cover; }
    40% { background: url(images/3.jpg) no-repeat center center fixed; background-size: cover; }
    60% { background: url(images/4.jpg) no-repeat center center fixed; background-size: cover; }
    80% { background: url(images/5.jpg) no-repeat center center fixed; background-size: cover; }
    100% { background: url(images/6.jpg) no-repeat center center fixed; background-size: cover; }
}
@-moz-keyframes imag {
    0% { background: url(images/1.jpg) no-repeat center center fixed; background-size: cover; }
    20% { background: url(images/2.jpg) no-repeat center center fixed; background-size: cover; }
    40% { background: url(images/3.jpg) no-repeat center center fixed; background-size: cover; }
    60% { background: url(images/4.jpg) no-repeat center center fixed; background-size: cover; }
    80% { background: url(images/5.jpg) no-repeat center center fixed; background-size: cover; }
    100% { background: url(images/6.jpg) no-repeat center center fixed; background-size: cover; }
}

之前谢谢:

看来Firefox和IE11都不喜欢在速记属性中定义。你已经把它放在了正确的速记语法位置,所以这是一种奇怪的行为

幸运的是,运行值是默认值,因此您可以删除它。如果确实要更改默认播放状态,可以将其定义为单独的属性:动画播放状态:running;这个很好用

使用背景色的工作示例 在Chrome、Firefox和IE11上测试

请注意,背景图像之间的过渡无法设置动画;他们只是从一个图像跳到另一个图像。如果需要,可以使用不透明度将其淡入/淡出

人头肌{ 文本对齐:居中; 高度:500px; 宽度:100%; 位置:相对位置; 边缘底部:15px; 背景:F00; 背景尺寸:封面; -webkit动画:imag 5s线性0s无限交替; 动画:imag 5s线性0s无限交替; 过渡:高度1s; } @-webkit关键帧图像{ 0% { 背景:FF0; } 20% { 背景:F90; } 40% { 背景:F80; } 60% { 背景:F06; } 80% { 背景:F50; } 100% { 背景:F90; } } @关键帧图像{ 0% { 背景:FF0; } 20% { 背景:F90; } 40% { 背景:F80; } 60% { 背景:F06; } 80% { 背景:F50; } 100% { 背景:F90; } }
@keyframes imag {
    0% { background: url(images/1.jpg) no-repeat center center fixed; background-size: cover; }
    20% { background: url(images/2.jpg) no-repeat center center fixed; background-size: cover; }
    40% { background: url(images/3.jpg) no-repeat center center fixed; background-size: cover; }
    60% { background: url(images/4.jpg) no-repeat center center fixed; background-size: cover; }
    80% { background: url(images/5.jpg) no-repeat center center fixed; background-size: cover; }
    100% { background: url(images/6.jpg) no-repeat center center fixed; background-size: cover; }
}
@-webkit-keyframes imag {
    0% { background: url(images/1.jpg) no-repeat center center fixed; background-size: cover; }
    20% { background: url(images/2.jpg) no-repeat center center fixed; background-size: cover; }
    40% { background: url(images/3.jpg) no-repeat center center fixed; background-size: cover; }
    60% { background: url(images/4.jpg) no-repeat center center fixed; background-size: cover; }
    80% { background: url(images/5.jpg) no-repeat center center fixed; background-size: cover; }
    100% { background: url(images/6.jpg) no-repeat center center fixed; background-size: cover; }
}
@-moz-keyframes imag {
    0% { background: url(images/1.jpg) no-repeat center center fixed; background-size: cover; }
    20% { background: url(images/2.jpg) no-repeat center center fixed; background-size: cover; }
    40% { background: url(images/3.jpg) no-repeat center center fixed; background-size: cover; }
    60% { background: url(images/4.jpg) no-repeat center center fixed; background-size: cover; }
    80% { background: url(images/5.jpg) no-repeat center center fixed; background-size: cover; }
    100% { background: url(images/6.jpg) no-repeat center center fixed; background-size: cover; }
}