Home  >  Article  >  Web Front-end  >  Why Does `transform: scale` Overflow in Chrome with `overflow: hidden` and `border-radius`?

Why Does `transform: scale` Overflow in Chrome with `overflow: hidden` and `border-radius`?

Linda Hamilton
Linda HamiltonOriginal
2024-10-30 20:47:18767browse

Why Does `transform: scale` Overflow in Chrome with `overflow: hidden` and `border-radius`?

Overflow Issue with Transform: Scale in Chrome

Problem:

While attempting to create a zoom effect using CSS transform: scale, it was discovered that the child div extended beyond the boundaries of the parent div when overflow: hidden and border-radius were applied to the parent. This issue persisted even when transitions were added.

Solution:

Adding transform: translateZ(0); to the wrapper element resolved the issue. As detailed in the provided demo, this technique manipulates the third dimension (Z-axis) to enhance performance and counteract the overflow problem.

The above is the detailed content of Why Does `transform: scale` Overflow in Chrome with `overflow: hidden` and `border-radius`?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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