0
我在導航鏈接上使用下劃線懸停效果。當我懸停在Safari上時,第一個懸停背景會根據我的CSS出現,但比我看到橙色背景。我發現如果我刪除僞元素的高度,這個橙色背景不可見。懸停錯誤:在Safari上之前
@mixin underline-reveal {
vertical-align: middle;
-webkit-transform: translateZ(0);
transform: translateZ(0);
box-shadow: 0 0 1px rgba(0, 0, 0, 0);
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
-moz-osx-font-smoothing: grayscale;
position: relative;
overflow: hidden;
}
@mixin underline-reveal-before ($color) {
content: "";
position: absolute;
z-index: -1;
left: 0;
right: 0;
bottom: 0;
background-color: $color;
height: 3px;
-webkit-transform: translateY(4px);
transform: translateY(4px);
-webkit-transition-property: transform;
transition-property: transform;
-webkit-transition-duration: 0.3s;
transition-duration: 0.3s;
-webkit-transition-timing-function: ease-out;
transition-timing-function: ease-out;
}