Arn*_*ink 1 css css-animations
建立动态的“提示”系统面临着挑战。我想仅使用CSS来使元素闪烁。不知道是否有可能。通常,您应该定义动画的开始和结束颜色 (更新:这是不正确的。),但是因为我想让它在多种背景颜色上起作用,所以这不是一个选择。
我尝试了许多选项和Google查询(继承,currentColor等),但它所做的只是从白色/透明到#ef9633。
有人有我可以尝试的选择吗?
码:
@keyframes nk-hint {
0% { background-color: #XXX; }
50% { background-color: #ef9633; }
100% { background-color: #XXX; }
}
@-webkit-keyframes nk-hint {
0% { background-color: #XXX; }
50% { background-color: #ef9633; }
100% { background-color: #XXX; }
}
Run Code Online (Sandbox Code Playgroud)
谢谢已经分配!
答案比我想的要简单。您只需删除0%和100%,即可在所有主流浏览器上正常运行。仍然需要在iOS和IE上进行测试。
可以肯定地说,您不需要设置开始和/或结束颜色。
@keyframes nk-hint {
50% { background-color: #ef9633; }
}
@-webkit-keyframes nk-hint {
50% { background-color: #ef9633; }
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
780 次 |
| 最近记录: |