悬停.css边框底部效果在 Opera 中无法正常工作



我正在使用悬停.css的悬停效果。它在每个浏览器中都能很好地运行,除了在 Opera 中。

当我删除属性时,它似乎仅在 Opera 中有效:

-webkit-transform: perspective(1px) translateZ(0);
transform: perspective(1px) translateZ(0);

但是,它在Firefox中不起作用。

我还创建了这个JSFiddle:

https://jsfiddle.net/ta4sju8n/20/

但它似乎在那里工作正常...

.HTML:

<ul>
  <li><a href="#">Hover me</a></li>
  <li><a href="#">Hover me</a></li>
  <li><a href="#">Hover me</a></li>
</ul>

SCSS:

body {
  background-color: black;
  color: white;
}
ul {
  list-style: none;
  li {
    padding: 10px;  
    a {
      display: inline-block;
      vertical-align: middle;
      -webkit-box-shadow: 0 0 1px rgba(0, 0, 0, 0);
      box-shadow: 0 0 1px rgba(0, 0, 0, 0);
      -webkit-transform: perspective(1px) translateZ(0);
      transform: perspective(1px) translateZ(0);
      position: relative;
      overflow: hidden;
      color: white;
      margin-top: 10px;
      margin-bottom: 10px;
      padding-bottom: 8px;
      text-decoration: none;
      /* Border bottom animation */ 
      &:after {
        content: "";
        position: absolute;
        z-index: -1;
        left: 0;
        right: 100%;
        bottom: 0;
        background: white;
        height: 1px;
        -webkit-transition-property: right;
        transition-property: right;
        -webkit-transition-duration: 0.3s;
        transition-duration: 0.3s;
        -webkit-transition-timing-function: ease-out;
        transition-timing-function: ease-out;
      }
      &:hover:after {
        right: 0;
      }
    }
  }
}

有人可以在这里帮助我吗?

更新:

问题已修复。我删除了perspective(1px),现在属性transform如下所示:

-webkit-transform: translateZ(0);
transform: translateZ(0);

最终代码:.HTML:

<ul>
  <li><a href="#">Hover me</a></li>
  <li><a href="#">Hover me</a></li>
  <li><a href="#">Hover me</a></li>
</ul>

SCSS:

body {
  background-color: black;
  color: white;
}
ul {
  list-style: none;
  li {
    padding: 10px;  
    a {
      display: inline-block;
      vertical-align: middle;
      -webkit-box-shadow: 0 0 1px rgba(0, 0, 0, 0);
      box-shadow: 0 0 1px rgba(0, 0, 0, 0);
      -webkit-transform: translateZ(0);
      transform: translateZ(0);
      position: relative;
      overflow: hidden;
      color: white;
      margin-top: 10px;
      margin-bottom: 10px;
      padding-bottom: 8px;
      text-decoration: none;
      /* Border bottom animation */ 
      &:after {
        content: "";
        position: absolute;
        z-index: -1;
        left: 0;
        right: 100%;
        bottom: 0;
        background: white;
        height: 1px;
        -webkit-transition-property: right;
        transition-property: right;
        -webkit-transition-duration: 0.3s;
        transition-duration: 0.3s;
        -webkit-transition-timing-function: ease-out;
        transition-timing-function: ease-out;
      }
      &:hover:after {
        right: 0;
      }
    }
  }
}