Home > Web Front-end > CSS Tutorial > Why is My Chrome Text Blurry After CSS Transform, and How Can I Fix It?

Why is My Chrome Text Blurry After CSS Transform, and How Can I Fix It?

Barbara Streisand
Release: 2024-12-13 20:55:47
Original
390 people have browsed it

Why is My Chrome Text Blurry After CSS Transform, and How Can I Fix It?

Blurry Text in Chrome After CSS Transform: Resolved with Backface Visibility Hidden and TranslateZ (0)

Scaling text using CSS transform: scale() can result in blurriness in recent versions of Google Chrome. This is evident in the main text area of http://rourkery.com, where the text appears smudged after transformation.

The solution to this issue lies in employing specific CSS properties. Adding backface-visibility: hidden simplifies the animation by focusing solely on the front of the object. The translateZ(0) property simulates hardware acceleration for smoother animation.

By incorporating these properties into the affected element, the blurriness is effectively eliminated. Here's an example snippet:

@-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);
    backface-visibility: hidden;
    transform: translateZ(0);
  }
}
Copy after login

For added clarity, some developers may also include -webkit-font-smoothing: subpixel-antialiased to enhance font rendering. However, the necessity of this property varies and is subject to personal preference.

The above is the detailed content of Why is My Chrome Text Blurry After CSS Transform, and How Can I Fix It?. 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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template