I faced a problem while building a simple CSS transition.
I have my body
element which its only child is a div
with position absolute.
Inside the div
I inserted a rectangle with a simple 3d transition on the hover pseudoclass: transform: rotateX(90deg)
, and I want to set a perspective
style in the parent element in order to make it appear better.
When I set a perspective
in the body the transition works properly: it creates the perspective effect and it looks good. But -and the problem is here- the child loses the absolute position (at least in Chrome).
I created a codepen example, you can comment the body
style out and this will apply an absolute position.
When the perspective
is set the div
also loses its blue background, but I think this happens because its height becomes 0.
Is it a bug? How can I fix it?
Thank you