首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >css悬停动画在ie11中不起作用。在IE中悬停在无法工作的元素上时的CSS转换

css悬停动画在ie11中不起作用。在IE中悬停在无法工作的元素上时的CSS转换
EN

Stack Overflow用户
提问于 2020-01-03 11:16:09
回答 2查看 241关注 0票数 0

我正在做一个悬停的动画。它在Chrome Safari和FireFox上运行良好。但不能在IE中工作。请帮我解决这个问题

代码语言:javascript
复制
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;
    }
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2020-01-03 13:32:21

我用IE 11浏览器测试了你的代码,动画运行良好。

代码语言:javascript
复制
<!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版本。

如果我对你上面的描述有任何误解,请告诉我,我会试着纠正我自己。

票数 0
EN

Stack Overflow用户

发布于 2020-01-03 11:20:27

我能为您提供的唯一帮助就是切换到IE9或更高版本。在该版本之前,不支持:after伪元素。在处理IE bug时,检查是否支持总是一个好主意。

https://caniuse.com/#search=%3Aafter

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59572761

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档