我正在尝试为 firefox(主题)中的工具栏背景颜色设置一个简单的淡入/淡出动画。问题是,我的颜色完全变透明了。我希望我的颜色褪色一半左右,然后开始逐渐变回全色。
我列出了我试过的代码...
toolbar{
animation-name: animation;
animation-duration: 5s;
animation-timing-function: ease-in-out;
animation-iteration-count: infinite;
animation-play-state: running;
}
@keyframes animation {
50.0% {background-color:red;}
}
我试过摆弄不透明度设置,但没有成功。感谢您的帮助。
最佳答案
@-webkit-keyframes animation {
0% {background-color:red;}
50.0% {background-color:#ff6666;} /* your chosen 'mid' color */
100.0% {background-color:red;}
}
@keyframes animation {
0% {background-color:red;}
50.0% {background-color:#ff6666;}
100.0% {background-color:red;}
}
关于CSS背景颜色关键帧动画,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24363205/