Internet explorer CSS3关键帧不会覆盖FF和IE10中的默认背景色
在chrome中,这可以按预期工作: “-webkit动画:fadeBox 1s轻松输入输出“overides”背景色:rgba(255255255,.9)“in#lightbox{}” 但在mozilla和ie10中,lightbox中的“背景色:rgba(255255255,.9)”似乎覆盖了动画:fadeBox 4s易于输入输出;我没有得到淡入淡出的效果 我必须在#lightbox中加入“background color:rgba(255255255,.9)”,这样当关键帧完成时,背景色保持为白色 我不知道firefox和IE10应该怎么做Internet explorer CSS3关键帧不会覆盖FF和IE10中的默认背景色,internet-explorer,firefox,css,css-transitions,css-animations,Internet Explorer,Firefox,Css,Css Transitions,Css Animations,在chrome中,这可以按预期工作: “-webkit动画:fadeBox 1s轻松输入输出“overides”背景色:rgba(255255255,.9)“in#lightbox{}” 但在mozilla和ie10中,lightbox中的“背景色:rgba(255255255,.9)”似乎覆盖了动画:fadeBox 4s易于输入输出;我没有得到淡入淡出的效果 我必须在#lightbox中加入“background color:rgba(255255255,.9)”,这样当关键帧完成时,背景色保
#lightbox {
position: fixed;
left: 0px;
right: 0px;
bottom: 0px;
top: 0px;
background-color: rgba(255,255,255,.9); <-----DEFAULT COLOR AFTER ANIMATION IS DONE
z-index: 150;
background-size: cover;
-webkit-animation: fadeBox 1s ease-in-out;
-moz-animation: fadeBox 4s ease-in-out;
animation: fadeBox 4s ease-in-out;
}
@-webkit-keyframes fadeBox {
0% { background-color: rgba(255,255,255,.0) }
100% { background-color: rgba(255,255,255,.9) }
}
@-moz-keyframes fadeBox {
0% { background-color: red }
100% { background-color: red }
}
@keyframes fadeBox {
0% { background-color: rgba(255,255,255.0) }
100% { background-color: rgba(255,255,255.9) }
}
#灯箱{
位置:固定;
左:0px;
右:0px;
底部:0px;
顶部:0px;
背景色:rgba(255255255.9);您的问题是关键帧CSS无效。特别是在IE和Mozilla都在使用的@keyframes
中,您的rgba()
只有三个参数,这对rgba()
无效
请注意,Firefox中的web控制台会告诉您错误:
[11:11:50.588] Expected an integer but found '255'. Error in parsing value for 'background-color'. Declaration dropped. @ file:///tmp/test.html:27
[11:11:50.588] Expected an integer but found '255.9'. Error in parsing value for 'background-color'. Declaration dropped. @ file:///tmp/test.html:28
尝试添加@-ms关键帧fadeBox
,为什么firefox关键帧中的背景色是红色?我使用红色只是为了看看moz关键帧是否会生效,它不会生效。据我所知,ie10没有使用供应商前缀。@Philip Jens Bramsted:d hee是正确的-@-ms关键帧
不存在,ie10使用的是不固定的关键帧锿。