【发布时间】:2013-11-20 06:04:13
【问题描述】:
我正在尝试更改首字母颜色并使用 css 为文本设置动画。在 Chrome 和 Safari 中它可以正常工作,但在 Internet Explorer 10 和 11 中我无法让它工作。这是我的css代码:
.amy:before {
content:"Amy";
}
.amy {
display: block;
width:50px;
height:30px;
color:#c63b2c;
font-size:24px;
}
.amy:hover {
display: block;
-webkit-animation-duration: 2s;
-webkit-animation-iteration-count: infinite;
-webkit-animation-name: wobble;
-moz-animation-duration: 2s;
-moz-animation-iteration-count: infinite;
-moz-animation-name: wobble;
-o-animation-duration: 2s;
-o-animation-iteration-count: infinite;
-o-animation-name: wobble;
animation-duration: 2s;
animation-iteration-count: infinite;
animation-name: wobble;
}
.amy:hover:first-letter {
color:black;
}
如果没有 :first-letter 伪元素,动画在 IE 中的效果就像一个魅力。
【问题讨论】:
-
你能举个例子让我们看看吗?
-
你能让 jsFiddle 显示它不起作用吗?我无法重现您的问题
-
在那个小提琴中有一大堆 CSS 代码。如何将其减少到证明问题所需的最低数量?
标签: html internet-explorer css internet-explorer-10 internet-explorer-11