动画:在css之后

时间:2015-09-02 08:34:02

标签: css

我试图弄清楚为什么这个简单的代码无效。

http://jsfiddle.net/yq1ro6n5/

@keyframes testing {
    from: {font-size: 42px;}
    to: {font-size: 64px;}
}
a:after {
    content: "Hello!";
    animation: testing 1s infinite;
}

-

<a></a>

任何人都可以解释一下吗?

1 个答案:

答案 0 :(得分:4)

从关键帧中删除:,如下所示

@keyframes testing {
from {
    font-size: 42px;
}
to {
    font-size: 64px;
}
}

&#13;
&#13;
a {
}
@keyframes testing {
    from {
        font-size: 42px;
    }
    to {
        font-size: 64px;
    }
}
a:after {
    content:"Hello!";
    animation: testing 3s infinite;
}
&#13;
<a></a>
&#13;
&#13;
&#13;