Bal*_*alo 6 html css google-chrome css3 css-animations
使用@keyframes(和animation)动画a颜色在Chrome中不起作用.
演示:https://jsfiddle.net/ed3pypwr/
在Chrome中,链接保持蓝色.在Firefox中,它按照预期从红色变为绿色.在div它上面也适用于Chrome.
有什么方法可以解决这个问题吗?
编辑
我知道它应该以前缀为前缀-webkit-以确保最大兼容性,但这不是问题.它无论如何都不起作用.
编辑2
解决方案是将链接放在包装器中并使用currentColor:https://jsfiddle.net/b84gttu6/.有没有更好的办法 ?
旧版本(<43)的 Chrome 使用前缀@-webkit-keyframes而不是标准@keyframes. 所以完整的支持看起来像这样:
@-webkit-keyframes test
{
from { color: red; }
to { color: green; }
}
@keyframes test
{
from { color: red; }
to { color: green; }
}
Run Code Online (Sandbox Code Playgroud)
更新:
我一直在使用各种不同的方法进行一些测试,并且仅当链接未被访问时才有效(为什么,我不知道)。