Working with CSS3 property transform: scale
, I found interesting issue. I wanted to make a little zoom effect for pictures. But when I used for the parent div overflow: hidden
and border-radius
, the child div extended the beyond of parent div.
Update:
Problem isn't solved. If I add transition
, is still doesn't work. I tried to solve this issue, but without success.
Here is a demo
It is because you are using position absolute. You cannot use position absolute with overflow hidden, because position absolute moves the targeted element out of context with the document structure.
translateZ() The translateZ() CSS function repositions an element along the z-axis in 3D space, i.e., closer to or farther away from the viewer. Its result is a <transform-function> data type.
scale() The scale() CSS function defines a transformation that resizes an element on the 2D plane. Because the amount of scaling is defined by a vector, it can resize the horizontal and vertical dimensions at different scales. Its result is a <transform-function> data type.
transform: translateZ(0);
on the wrap element did the trick for me.
See CSS performance relative to translateZ(0) for more information about this technique.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With