【发布时间】:2016-03-12 01:28:57
【问题描述】:
this transition 的基本理念是在我将鼠标悬停时增加字体真棒图标和文本的大小。
它在 Chrome、Opera、Safari 和 Firefox 中运行良好,但不适用于 IE 11。
该示例显示了使用 px(类 test1)和 em(类 test2)的相同转换;我使用 px 没有问题;该问题特定于以下场景:
效果:过渡
类型:伪元素
属性:字体大小
单位:em
浏览器:IE 11
.test1 span{
font-size: 40px;
-webkit-transition: all 0.4s ease;
-moz-transition: all 0.4s ease;
transition: all 0.4s ease;
}
.test1::before{
font-family: FontAwesome;
font-size: 20px;
content: "\f08e";
position: relative;
-webkit-transition: all 0.4s ease;
-moz-transition: all 0.4s ease;
transition: all 0.4s ease;
}
.test1:hover span{
font-size: 80px;
-webkit-transition: all 0.4s ease;
-moz-transition: all 0.4s ease;
transition: all 0.4s ease;
}
.test1:hover::before{
font-size: 40px;
-webkit-transition: all 0.4s ease;
-moz-transition: all 0.4s ease;
transition: all 0.4s ease;
}
.test2 span{
font-size: 1em;
-webkit-transition: all 0.4s ease;
-moz-transition: all 0.4s ease;
transition: all 0.4s ease;
}
.test2::before{
font-family: FontAwesome;
font-size: 0.5em;
content: "\f08e";
position: relative;
-webkit-transition: all 0.4s ease;
-moz-transition: all 0.4s ease;
transition: all 0.4s ease;
}
.test2:hover span{
font-size: 2em;
-webkit-transition: all 0.4s ease;
-moz-transition: all 0.4s ease;
transition: all 0.4s ease;
}
.test2:hover::before{
font-size: 1em;
-webkit-transition: all 0.4s ease;
-moz-transition: all 0.4s ease;
transition: all 0.4s ease;
}
<html>
<head>
<link rel="stylesheet" href="https://fortawesome.github.io/Font-Awesome/assets/font-awesome/css/font-awesome.css">
</head>
<body>
<table>
<tr style="font-size: 40px;">
<td class="test1">
<span>Text 01</span>
</td>
</tr>
<tr style="font-size: 40px;">
<td class="test2">
<span>Text 01</span>
</td>
</tr>
</table>
</body>
</html>
我在这里遗漏了什么吗? IE 中是否存在已知问题?
我能找到的最相似的问题是this one,它提到了 IE 中的一个已知问题,但它似乎是一个不同的问题。
【问题讨论】:
标签: css internet-explorer internet-explorer-11