Blurry text on transform:rotate in Chrome

后端 未结 6 577
暖寄归人
暖寄归人 2020-12-10 04:38

I\'m building a website with a wrapper div that is rotated (transform:rotate(10deg)). The text inside the div also rotates. I want the text straight, so I rotat

6条回答
  •  南方客
    南方客 (楼主)
    2020-12-10 04:45

    For anyone who is still running into this issue, despite having tried the previous suggestions:

    I have found that if you put a perspective property on the parent element being rotated, it completely fixes the issue. The value can be anything above 0, assuming you're not using any 3d transforms.

    Example CSS:

    .parent {
        transform: rotate(10deg);
        perspective: 100px;
    }
    
    .child {
        transform: rotate(-10deg);
    }
    

提交回复
热议问题