【发布时间】:2021-05-23 07:42:04
【问题描述】:
问题 无法让 CSS @-webkit-keyframe 动画与 content-tag 一起使用。以下代码在 Chrome 和 Firefox 上运行良好,但 Safari 仍不显示“STRING1”。 我已经尝试了论坛中的所有内容,但仍然无法正常工作。 有人能帮我吗?非常感谢。
html:
<h1>TEST:<span></span></h1>
css:
@-webkit-keyframes textchange {
0% {content: 'STRING1';}
30% {content: 'SRING2';}
60% {content: 'STRING3';}
100% {content: 'STRING1';}
}
@-moz-keyframes textchange {
0% {content: 'STRING1';}
30% {content: 'SRING2';}
60% {content: 'STRING3';}
100% {content: 'STRING1';}
}
@-o-keyframes textchange {
0% {content: 'STRING1';}
30% {content: 'SRING2';}
60% {content: 'STRING3';}
100% {content: 'STRING1';}
}
@keyframes textchange {
0% {content: 'STRING1';}
30% {content: 'SRING2';}
60% {content: 'STRING3';}
100% {content: 'STRING1';}
}
h1 span::before{
content:'STRING1';
-webkit-animation-name: textchange;
-webkit-animation-duration: 6s;
-webkit-animation-iteration-count: infinite;
-webkit-animation-timing-function: linear;
-webkit-animation-play-state: running;
-webkit-animation-direction: normal;
-webkit-animation-delay:0.01s;
-webkit-animation-fill-mode: forwards;
-o-animation: textchange 6s linear 0.01s infinite;
-ms-animation: textchange 6s linear 0.01s infinite;
-moz-animation: textchange 6s linear 0.01s infinite;
animation: textchange 6s linear 0.01s infinite;
}
【问题讨论】:
标签: safari webkit css-animations keyframe