gpt4 book ai didi

css - :before underline animation applied to a sibling时旋转的元素变得模糊

转载 作者:行者123 更新时间:2023-11-28 15:36:20 25 4
gpt4 key购买 nike

该模式有两个 anchor ,当兄弟节点有 :before 下划线动画时,其中一个会旋转并变得模糊。您能否建议当前问题的可能解决方案是什么?

.sibling {
position: relative;
margin: 30px;
}

.sibling:hover:before {
visibility: hidden;
transform: scaleX(0);
}

.sibling:before {
content: "";
width: 100%;
height: 1px;
position: absolute;
bottom: 0;
left: 0;
background-color: #000;
visibility: visible;
transform: scaleX(1);
transition: all 0.4s ease-in-out;
}

.rotated {
transform: rotate(-90deg);
margin: 30px;
position: absolute;
}
<a class='sibling'>Sibling</a>
<a class='rotated'>Rotated</a>

最佳答案

translate3d(0,0,0)-webkit-font-smoothing: antialiased; 添加到您的旋转文本。这应该有效。

.sibling {
position: relative;
margin: 30px;
}

.sibling:hover:before {
visibility: hidden;
transform: scaleX(0);
}

.sibling:before {
content: "";
width: 100%;
height: 1px;
position: absolute;
bottom: 0;
left: 0;
background-color: #000;
visibility: visible;
transform: scaleX(1);
transition: all 0.4s ease-in-out;
}

.rotated {
transform: rotate(-90deg) translate3d(0,0,0);
margin: 30px;
position: absolute;
-webkit-font-smoothing: antialiased;
}
<a class='sibling'>Sibling</a>
<a class='rotated'>Rotated</a>

关于css - :before underline animation applied to a sibling时旋转的元素变得模糊,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44101496/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com