2016-08-07 124 views
1

在我的網站後,我得到這個CSS代碼CSS動畫 - 更改背景圖片的顏色變化

@-webkit-keyframes colours { 
0% {color: red; color: lime; color: red;} 
25% {color: lime;} 
50% {color: red;} 
75% {color: lime;} 
100% {color: red;} 
} 
-webkit-animation: colours 1.5s infinite alternate !important; 

每次色彩的變化我可以把它切換

之間
background-image: url("/images/redshield.png"); 

background-image: url("/images/greenshield.png"); ? 

回答

1

請注意,這將繼續循環...但這樣的事情應該工作。

@-webkit-keyframes colours { 
    0% { 
     color: red; 
     background-image: url("/images/redshield.png"); 
    } 
    25% {color: lime;} 
    50% { 
     color: red; 
     background-image: url("/images/greenshield.png"); 
    } 
    75% {color: lime;} 
    100% {color: red;} 
} 

-webkit-animation: colours 1.5s infinite alternate !important; 
+0

它的工作,謝謝 – bdb