WebKit browsers, including Chrome, exhibit a peculiar issue where CSS-scaled content experiences significant blurriness when combined with translate3d property. This issue hampers content rendering and impacts user experience.
In the provided JavaScript Fiddle, we can observe the issue. The HTML code includes two
The root cause of this issue lies in WebKit's treatment of 3D-transformed elements as textures rather than vectors. This approach enables hardware 3D acceleration but degrades text quality. To mitigate the issue, one workaround involves increasing the text size and downscaling the element, effectively creating a higher-resolution texture.
As demonstrated in an updated Fiddle, we can upscale the text size within the "testInner" element and downscale the element itself. This approach improves text quality, though antialiasing may still be imperfect. To further enhance readability, we can apply text shadow to thicken the text stems.
By adopting this workaround, we can circumvent the blurriness issue and achieve a more visually appealing presentation of CSS-scaled content combined with translate3d. It is crucial to note that this solution may not be suitable for all scenarios; however, it provides a valuable alternative in cases where text quality is paramount.
The above is the detailed content of Why Does CSS Scaling and Translate3D Cause Text Blurriness in WebKit Browsers?. For more information, please follow other related articles on the PHP Chinese website!