【发布时间】:2012-09-23 00:03:06
【问题描述】:
我正在用 CSS 制作关键帧动画。由于支持 -webkit 语法,因此动画在 Chrome 中似乎运行良好。
@-webkit-keyframes title_toggle
{
from { background-image:url(images/title.png); }
75%{ background-image:url(images/title_hover.png); }
to { background-image:url(images/title.png); }
}
我为 Firefox 尝试了下面的代码,但它不起作用
@-moz-keyframes title_toggle {
from { background-image:url(images/title.png); }
75%{ background-image:url(images/title_hover.png); }
to { background-image:url(images/title.png); }
}
请让我知道我会在 FF 中进行这项工作。
这是 CSS 部分。
@-moz-keyframes title_toggle {
from { background-image:url(images/title.png); }
75%{ background-image:url(images/title_hover.png); }
to { background-image:url(images/title.png); }
}
.title{
width:40%;
height: 30%;
position: absolute;
top: 10%;
left: 5%;
background-size: 100% 100%;
background-repeat:no-repeat;
-webkit-animation-name: title_toggle;
-webkit-animation-duration:5s;
-webkit-animation-iteration-count:infinite;
background-size: 100% 100%;
-moz-animation-name: title_toggle;
-moz-animation-duration:5s;
-moz-animation-iteration-count:infinite;
}
这是 HTML
<div class="title"></div>
【问题讨论】:
-
您测试的是哪个版本的 Firefox?
-
15.0.1 的东西!我昨天刚下载...
-
这应该可行,语法完美..你确定它失败了吗?
-
是的...等等,让我发布完整的 CSS 和 HTML。
-
网站在aspspider.org/samarth工作,用chrome和firefox查看
标签: html css firefox animation keyframe