【发布时间】:2015-06-24 20:53:00
【问题描述】:
我想定义一个 CSS3 动画,在动画过程中的某些时候,它使用属性的自然值,就好像没有应用动画一样。
例如
@keyframes fadeblue
{
0%
{
background-color: natural;
}
100%
{
background-color: blue;
}
}
.thing1
{
background-color: red;
animation: fadeblue 2s;
}
.thing2
{
background-color: green;
animation: fadeblue 2s;
}
thing1 将从红色变为蓝色,而 thing2 将从绿色变为蓝色。
在 0% 关键帧中,我应该使用什么值代替 natural?
我尝试过继承和透明,但都没有达到预期的效果。
注意我知道这可以通过 JavaScript 解决方案来完成,但如果可能的话,我更喜欢纯 css3 解决方案。
【问题讨论】: