html - 边框没有回来,从 EDGE 中的元素中删除了悬停

标签 html css

我希望在从元素中移除悬停后边框回到正常位置,这在 chrome、Firefox 中工作正常,但在 EDGE 中不工作

  <span class="cta-content">
       <span class="cta-text">demo</span>
       <span class="icon">i</span>
   </span>

.cta-content{
            background: linear-gradient(0deg, blue, blue) bottom left no-repeat;
            background-color: none !important;
            background-size: 0px 1px;
            transition: 0.5s background-size;
            text-decoration: none;
            display: inline !important;
        }
        .cta-content:hover{
            background-size: 100% 1px;
            color:red;
        }
  <span class="cta-content">
           <span class="cta-text">demo</span>
           <span class="icon">i</span>
       </span>

最佳答案

始终添加 HTML 呈现引擎。

.cta-content {
  background: linear-gradient(0deg, blue, blue) bottom left no-repeat;
  background-color: none !important;
  background-size: 0px 1px;
  -webkit-transition: 0.5s background-size;
  -moz-transition: 0.5s background-size;
  -o-transition: 0.5s background-size;
  transition: 0.5s background-size;
  text-decoration: none;
  display: inline !important;
}

.cta-content:hover {
  background-size: 100% 1px;
  color: red;
}
<span class="cta-content">
       <span class="cta-text">demo</span>
<span class="icon">i</span>
</span>

关于html - 边框没有回来,从 EDGE 中的元素中删除了悬停,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54929911/

相关文章:

javascript - CSS3转换后用JS获取div大小

html - 无法摆脱自定义滚动条和 DIV 之间的额外空间

html - 将表列分成 3 个部分

css - 模态对话框的大小和标题位置

html - Twitter Bootstrap 用户 - 你如何处理各种垂直定位/间距?

html - 如何垂直对齐列表或 div 中的图像?

css - 单选按钮的 Bootstrap 表单组

html - 有没有办法让可变宽度字体在 HTML 中表现得像固定宽度字体?

html - 向右浮动将 div 推到页面末尾

javascript - 对函数中的变量进行分组