我有一段文字
transform: rotate(-45deg) scale(1.6);
和他的父元素 block ,其中有
transform: rotate(45deg) translateX(30%)
而且文字是平滑的。到目前为止我已经尝试过:
font-smoothing: antialiased;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
font-variant-ligatures: none;
-webkit-font-variant-ligatures: none;
text-rendering: optimizeLegibility;
-webkit-backface-visibility: hidden;
transform: perspective(1px) translateZ(0) translate3d(0, 0, 0);
如何修复平滑?
最佳答案
如您所见,这个简单示例没有平滑文本。
正如@Temani Afif 在评论中所说,如果您想要更准确的回复,请放一个重现您的问题的片段。
div {
position: absolute;
width: 100px;
height: 100px;
border: 1px solid gray;
}
div:first-child {
top: 150px;
}
p.rotate {
border: 1px solid blue;
transform: rotate(45deg) translateX(30%);
}
p.rotate span {
display: block;
transform: rotate(-45deg) scale(1.6);
border: 1px solid green;
}
<div>
<p class=rotate>
<span>TOTO</span>
</p>
</div>
<div>
<p>
<span>TOTO</span>
</p>
</div>
关于css - 转换导致文本平滑,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46709136/