【发布时间】:2017-03-31 15:05:23
【问题描述】:
我正在使用 after 伪元素在 h3 悬停上进行非常简单的转换。我读过 ::after 在 IE10 上工作(它在渲染它时工作),但不是悬停。
h3 {
position:relative;
}
h3::after {
content: '';
display: block;
position: absolute;
bottom: -5px;
width: 10px;
height: 2px;
background: blue;
left: 0;
-ms-transition: all .5s;
transition: all .5s;
}
h3:hover::after {
width: 100%;
}
h3 a {
text-decoration: none;
position: relative;
display: inline-block;
}
<!DOCTYPE html>
<h3>
<a href='#'>Hello</a>
</h3>
其他浏览器也有魅力,我不知道IE10会发生什么...
【问题讨论】:
-
ie10 仿真对我有用。
-
@Huelfe 它对你有用吗?我在 IE10 中尝试了完全相同的代码,但不起作用。我不知道为什么,但是如果我尝试使用
<a>而不是<h3>它会起作用。
标签: html css hover internet-explorer-10