css - Webkit 关键帧不工作

标签 css animation webkit

我想使用关键帧使客户的站点 Logo (只是使用@font-face 的文本)淡入和淡出不同的颜色。不知何故,我根本无法让它工作!

@-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;
}

最佳答案

对我来说你的代码工作得很好:

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;
}

关于css - Webkit 关键帧不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26289441/

相关文章:

java - SplashScreen java 更改 alpha

html - toDataURL 不适用于带有 SVG 图像的 html5 Canvas

java - 在 Java 中处理 JavaScript?

ios - 如何从 WKWebView 获取服务器响应

html - 使用动态 HTML 进行 Azure AD B2C UI 自定义

css - 多行虚线文本下划线

animation - Airbnb.com 标志像动画

css - Tailwind CSS 如何编写像素完美的设计

javascript - 如何在 iFrame 中更改 css 背景颜色

jquery - 我怎样才能减慢这个jquery slider 的动画速度