在 blog.etree.biz/shops.html @keyframe
无法在 firefox 浏览器上运行。
<style>
.content-fauxcolumns, .content {
background-image: url("http://www.etree.biz/wp-content/themes/Etree%20Theme/images/jkbg.jpg");
-webkit-animation: backgrounds 30s infinite;
animation: backgrounds 30s infinite;
}
@-webkit-keyframes backgrounds {
0% {background-image: url("http://www.etree.biz/wp-content/themes/Etree%20Theme/images/ascotbg.jpg");}
20% {background-image: url("http://www.etree.biz/wp-content/themes/Etree%20Theme/images/jayseebg.jpg");}
40% { background-image: url("http://www.etree.biz/wp-content/themes/Etree%20Theme/images/winebg.jpg");}
60% {background-image: url("http://www.etree.biz/wp-content/themes/Etree%20Theme/images/shedbg.jpg");}
80% {background-image: url("http://www.etree.biz/wp-content/themes/Etree%20Theme/images/snowbg.jpg");}
95% {background-image: url("http://www.etree.biz/wp-content/themes/Etree%20Theme/images/glovesbg.jpg");}
100% {background-image: url("http://www.etree.biz/wp-content/themes/Etree%20Theme/images/ascotbg.jpg");}
}
@keyframes backgrounds {
0% {background-image: url("http://www.etree.biz/wp-content/themes/Etree%20Theme/images/ascotbg.jpg");}
20% {background-image: url("http://www.etree.biz/wp-content/themes/Etree%20Theme/images/jayseebg.jpg";);}
40% { background-image: url("http://www.etree.biz/wp-content/themes/Etree%20Theme/images/winebg.jpg");}
60% {background-image: url("http://www.etree.biz/wp-content/themes/Etree%20Theme/images/shedbg.jpg");}
80% {background-image: url("http://www.etree.biz/wp-content/themes/Etree%20Theme/images/snowbg.jpg");}
95% {background-image: url("http://www.etree.biz/wp-content/themes/Etree%20Theme/images/glovesbg.jpg");}
100% {background-image: url("http://www.etree.biz/wp-content/themes/Etree%20Theme/images/ascotbg.jpg");}
}
.content-fauxcolumns, .etreefooter, #navlinks, .mainmenu, #navlinks:link, #navlinks:visited, .etreeMobileHeader {
background-color:#41873A;
color:#FFF;
-webkit-animation: backgroundColor 30s infinite;
animation: backgroundColor 30s infinite;
}
@-webkit-keyframes backgroundColor {
0% {background-color:#41873A;}
20% {background-color:#B6B757;}
40% {background-color:#9C2757;}
60% {background-color:#749B1D;}
80% {background-color:#284C9C;}
95% {background-color:#AE4F06;}
100% {background-color:#41873A;}
}
@keyframes backgroundColor {
0% {background-color:#41873A;}
20% background-color:#B6B757;}
40% {background-color:#9C2757;}
60% {background-color:#749B1D;}
95% {background-color:#AE4F06;}
100% {background-color:#41873A;}
}
#navlinks:hover, #navlinks:active {
background-color:#FFF;
}
</style>
根据我的知识,简单的动画版本应该可以工作,但是在遵循 firefoxe 的开发人员示例之后,我仍然无法让代码在该浏览器上运行。
问题是什么,是否有可能的解决方案?
最佳答案
最后一个关键帧你在 20% 处缺少一个“{”,不知道是不是因为这个,但无论如何你应该修复它。
@keyframes backgroundColor {
0% {background-color:#41873A;}
20% background-color:#B6B757;}
40% {background-color:#9C2757;}
60% {background-color:#749B1D;}
95% {background-color:#AE4F06;}
100% {background-color:#41873A;}
背景部分:
@keyframes backgrounds {
0% {background-image: url("http://www.etree.biz/wp-content/themes/Etree%20Theme/images/ascotbg.jpg");}
20% {background-image: url("http://www.etree.biz/wp-content/themes/Etree%20Theme/images/jayseebg.jpg";);}
40% { background-image: url("http://www.etree.biz/wp-content/themes/Etree%20Theme/images/winebg.jpg");}
60% {background-image: url("http://www.etree.biz/wp-content/themes/Etree%20Theme/images/shedbg.jpg");}
80% {background-image: url("http://www.etree.biz/wp-content/themes/Etree%20Theme/images/snowbg.jpg");}
95% {background-image: url("http://www.etree.biz/wp-content/themes/Etree%20Theme/images/glovesbg.jpg");}
100% {background-image: url("http://www.etree.biz/wp-content/themes/Etree%20Theme/images/ascotbg.jpg");}
}
在 20% 的时候你有一个 ';'更多
关于html - FireFox CSS 动画无法运行。,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28770520/