-1
我之前在firefox中遇到过gradiens问题。然后,我将background: -moz-linear-gradient(left,red,blue);
放在DIV中,而不是@keyframes changeSizeAndColor{}
现在我的问题是,它不会从蓝色变为红色,而是始终(红色和蓝色)。火狐的动画/梯度CSS3支持
这里的代码:
#fifth-div{
position: absolute;
left:0;
right:0;
margin-left:auto;
margin-right:auto;
text-align: center;
font-family: helvetica;
font-size: 5px;
background-color: blue;
width: 200px;
height: 200px;
animation-name: changeSizeAndColor;
animation-duration: 3s;
animation-iteration-count: infinite;
-webkit-animation: changeSizeAndColor 5s infinite; /* Chrome, Safari, Opera */
animation: changeSizeAndColor 5s infinite;
background: -webkit-gradient();
background: -moz-linear-gradient(left,red,blue);
这(下同)是我的渊源开始了。没有我的任何地方。然后,我添加了如上所述的这行代码:background:-moz-linear-gradient(left,red,blue);在CSS中(在div中),我得到了radient的工作,但没有从蓝色转移到radient(蓝色&红色)(它只是显示了upp radient没有从蓝色转移到radient(红色&蓝色)其他浏览器。
@keyframes changeSizeAndColor {
from {
width: 200px;
height: 200px;
background-color: blue;
font-size: 5px;
}
to {
width: 300px;
height: 300px;
font-size: 25px;
background: -webkit-linear-gradient(left, red, blue);
background: -o-linear-gradient(right, red, blue);
background: repeating-linear-gradient(right, red, blue);
background image: -moz-linear-gradient(left, red, blue);
}
究竟什么是你想怎么办?背景何时应该从蓝色变为蓝色和红色? – Harry
该代码在帖子中。我编辑了它,现在看起来很清楚 –