-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
該代碼在帖子中。我編輯了它,現在看起來很清楚 –