html - 为什么我的 CSS 动画在除 Safari 之外的所有浏览器中都有效?
问题描述
我的 CSS 动画适用于除 Safari 之外的所有浏览器。有人可以告诉我为什么会这样,或者我需要做哪些改变才能使其普遍工作?
#job-title:before {
content: '';
animation-name: animate;
animation-iteration-count: infinite;
animation-timing-function: linear;
animation-duration: 4s;
animation-delay: 1s;
}
@keyframes animate {
0% {
content: "Web Developer.";
}
50% {
content: "Web Designer.";
}
100% {
content: "Graphic Designer.";
}
}
解决方案
您可以尝试-webkit
为动画添加前缀吗?
#job-title:before {
content: '';
-webkit-animation-name: animate;
animation-name: animate;
-webkit-animation-iteration-count: infinite;
animation-iteration-count: infinite;
-webkit-animation-timing-function: linear;
animation-timing-function: linear;
-webkit-animation-duration: 4s;
animation-duration: 4s;
-webkit-animation-delay: 1s;
animation-delay: 1s;
}
@-webkit-keyframes animate {
0% {
content: "Web Developer.";
}
50% {
content: "Web Designer.";
}
100% {
content: "Graphic Designer.";
}
}
@keyframes animate {
0% {
content: "Web Developer.";
}
50% {
content: "Web Designer.";
}
100% {
content: "Graphic Designer.";
}
}
推荐阅读
- node.js - Firebase 错误:加载用户代码(node.js)时函数失败
- css - 垂直响应 CSS 图像
- html - 如何更改代码中已经定义的 css 样式?
- python - iPython Parallel 模块消耗大量内存
- php - PHP Upload 增加了上传/处理时间
- sql-server - 使用 sp-send-dbmail 将 Canvas 转换为图像并通过电子邮件发送
- google-cloud-platform - 如何使用 curl 启用 GCP 服务服务使用?
- angular - Angular中的CORS错误-基于flask socketIO
- jenkins - Jenkins 具有不同构建参数的多个 cron 触发器
- qt - 如何应用条件数格式?