2014-10-09 58 views
0

我想使用关键帧来制作客户端的站点徽标(只是使用@ font-face的文本)淡入淡出不同的颜色。不知何故,我无法得到这个工作!Webkit关键帧不工作

@-webkit-keyframes colorPulse { 0% {color: rgba(236, 250, 42, 0.6);} 
50% {color: rgba(253, 149, 223, 0.6);} 100% {color: rgba(1, 218, 213, 0.6);} } 

#site-logo { 
font-family: KaBlamo; 
font-size: 90px; 
text-align: center; 
width: 100%; 
position: absolute; 
top: 30px; 
margin: 20px 0 .4em; 
-webkit-animation: colorPulse 15s infinite alternate; 
} 

回答

0

对我来说,你的代码工作相当不错:

https://jsfiddle.net/3frdpw4h/

哪些浏览器您使用?也许你必须提供前置动画属性+关键帧规则?

@-webkit-keyframes colorPulse { 
    0% {color: rgba(236, 250, 42, 0.6);} 
    50% {color: rgba(253, 149, 223, 0.6);} 
    100% {color: rgba(1, 218, 213, 0.6);} 
} 
@keyframes colorPulse { 
    0% {color: rgba(236, 250, 42, 0.6);} 
    50% {color: rgba(253, 149, 223, 0.6);} 
    100% {color: rgba(1, 218, 213, 0.6);} 
} 

#site-logo { 
    font-family: KaBlamo; 
    font-size: 90px; 
    text-align: center; 
    width: 100%; 
    position: absolute; 
    top: 30px; 
    margin: 20px 0 .4em; 
    -webkit-animation: colorPulse 15s infinite alternate; 
    animation: colorPulse 15s infinite alternate; 
}