Home >Web Front-end >CSS Tutorial >Why Does Translate3d Cause Blurry Text in WebKit-Based Browsers?
Webkit-Based Blurry Text Issue in Animated Elements Using translate3d
A common problem encountered across WebKit-based browsers, including the iPhone, is distorted and blurry text after implementing translate3d for animations. This can be particularly prevalent when using -webkit-transform: translate3d as the animation method.
One potential solution suggested in forums involved removing relative positioning and adding a -webkit-font-smoothing: antialiased rule. However, these adjustments often prove ineffective.
Dirty Solution
As a potential workaround, while not an elegant or optimal one, adjusting the positioning by adding a fraction to the transform values has been reported to mitigate the issue:
top: 49.9%; left: 49.9%; -webkit-transform: translate(-50.1%, -50.1%); transform: translate(-50.1%, -50.1%);
This technique relies on slightly offsetting the transform with a fraction, which seems to prevent the blurring effect associated with translate3d animations in WebKit browsers.
Other Considerations:
Alternative approaches may include:
The above is the detailed content of Why Does Translate3d Cause Blurry Text in WebKit-Based Browsers?. For more information, please follow other related articles on the PHP Chinese website!