我正在做一个悬停的动画。它在Chrome Safari和FireFox上运行良好。但不能在IE中工作。请帮我解决这个问题
a {
color: white;
font-size: 13px;
margin-right: 5px;
transition: all 0.2s ease-in;
display: block;
}
a:hover {
margin-right: 25px;
background: red;
}
a::after {
content: url(../../images/ICON_DOWNLOAD.png);
position: absolute;
right: -30px;
transition: all 0.2s ease-in;
}
a:hover::after {
right: 15px;
}发布于 2020-01-03 13:32:21
我用IE 11浏览器测试了你的代码,动画运行良好。
<!DOCTYPE html>
<html lang="en">
<head>
<title>Example</title>
<style>
a {
color: white;
font-size: 13px;
margin-right: 5px;
transition: all 0.2s ease-in;
display: block;
}
a:hover {
margin-right: 25px;
background: red;
}
a::after {
content: url(https://i.postimg.cc/c4QJc7R1/down.png);
position: absolute;
right: -30px;
transition: all 0.2s ease-in;
}
a:hover::after {
right: 15px;
}
</style>
</head>
<body>
<a href="#">This is link</a>
</body>
</html>
IE 11中的输出:

如果您使用的是任何较旧版本的IE,则建议升级到iE 11版本。
如果我对你上面的描述有任何误解,请告诉我,我会试着纠正我自己。
发布于 2020-01-03 11:20:27
我能为您提供的唯一帮助就是切换到IE9或更高版本。在该版本之前,不支持:after伪元素。在处理IE bug时,检查是否支持总是一个好主意。
https://stackoverflow.com/questions/59572761
复制相似问题