Home > Web Front-end > CSS Tutorial > Why is My Text Blurry in Chrome After Using `transform: scale()`?

Why is My Text Blurry in Chrome After Using `transform: scale()`?

DDD
Release: 2024-12-10 15:51:11
Original
427 people have browsed it

Why is My Text Blurry in Chrome After Using `transform: scale()`?

Text Blurriness in Chrome after transform: scale()

In recent Chrome updates, a peculiar issue has emerged where text rendered using CSS's transform: scale() property appears blurry. This issue has been observed when using this specific code:

@-webkit-keyframes bounceIn {
  0% {
    opacity: 0;
    -webkit-transform: scale(.3);
  }

  50% {
    opacity: 1;
    -webkit-transform: scale(1.05);
  }

  70% {
    -webkit-transform: scale(.9);
  }

  100% {
    -webkit-transform: scale(1);
  }
}
Copy after login

Visiting rourkery.com in Chrome reveals the problem on the main text area, while other WebKit browsers (like Safari) seem unaffected.

A Solution to the Blurry Text Conundrum

To resolve this issue, two approaches can be employed:

  1. Backface Visibility Hidden: This technique fixes the issue by simplifying the animation to just the front of the object, eliminating the default front and back states.

    backface-visibility: hidden;
    Copy after login
  2. TranslateZ: This hack activates hardware acceleration for the animation, effectively solving the rendering problem.

    transform: translateZ(0);
    Copy after login

In addition, some users find adding the following property beneficial:

-webkit-font-smoothing: subpixel-antialiased;
Copy after login

The above is the detailed content of Why is My Text Blurry in Chrome After Using `transform: scale()`?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template