How to prevent children from inheriting 3d transformation CSS3?
I have a parent div and a child div, now I want to let parent using 3d transformation and the child div keep front.
Example:
.parent {
transform: rotateX(33deg) rotateY(66deg) rotateZ(99deg);
position: relative;
width: 300px;
height: 300px;
margin: 50px auto;
border: 4px solid darkblue;
}
.child {
position: absolute;
width: 80px;
height: 80px;
background: aqua;
}
<div class="parent">
<div class="child">
I'am a child want keep front.
</div>
</div>
Set contrarotation, or set none transform is no effect.
.parent {
transform: rotateX(33deg) rotateY(66deg) rotateZ(99deg);
position: relative;
width: 300px;
height: 300px;
margin: 50px auto;
border: 4px solid darkblue;
}
.child {
transform: rotateX(-33deg) rotateY(-66deg) rotateZ(-99deg);
position: absolute;
width: 80px;
height: 80px;
background: aqua;
}
<div class="parent">
<div class="child">
I'am a child want keep front.
</div>
</div>