【发布时间】:2019-06-26 14:08:23
【问题描述】:
我创建了一个动画来循环浏览一组单独的 FontAwesome 图标。它适用于最新的 Firefox 和 Chrome,但在 IE(10、11、Edge)上,图标根本不会改变。
为了证明 IE 至少在尝试动画,我添加了颜色 CSS。
这是仅靠 CSS 无法在 IE 上完成的事情吗?
i::before {
animation: battery 5s infinite;
font-size:2em;
}
@keyframes battery {
0% { content: "\f244"; color:red; }
25% { content: "\f243"; color:green; }
50% { content: "\f242"; color:blue; }
75% { content: "\f241"; color:yellow; }
100% { content: "\f240"; color:purple; }
}
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css" crossorigin="anonymous">
<i class="fas fa-battery-empty"></i>
【问题讨论】:
-
您可以将 5 个图标堆叠起来,并对每个图标的不透明度进行动画处理
-
有趣的方法,我试试看
-
在 IE 中不支持对 content 属性进行动画处理:css-tricks.com/animating-the-content-property
-
感谢@heatherhtml - 至少这增加了对为什么它没有在 IE 中发生的确认
标签: css internet-explorer css-animations font-awesome font-awesome-5