I found transform
property depends on perspective()
position
why is this happening? any other rules/limitations for transform
?
though it feels strange to me, this not seems to be a bug as I am able to reproduce this in Chrome/FF
box:nth-child(1):hover {
transform: perspective(1000px) translate3d(0, 0, -100px);
}
box:nth-child(2):hover {
transform: translate3d(0, 0, 100px) perspective(1000px);
}
box {
padding: 20px;
display: inline-flex;
align-items: center;
justify-content: center;
font-family: monospace;
transition: transform .4s;
background: rgba(255, 0, 0, 0.3);
margin: 20px;
font-size: 12px;
perspective: 1000px;
cursor: pointer;
}
box:nth-child(2) {
background: rgba(0, 0, 255, 0.3);
}
<box>
transform: perspective(1000px) translate3d(0,0,100px);
</box>
<box>
transform: translate3d(0,0,100px) perspective(1000px);
</box>