문제

I have this snippet implemented:

CSS

div
{
    position:absolute;
    -webkit-transition: all 0.3s ease-out;
}
.block
{
    background:#fc0; /* YELLOW */
    top:50px;
    left:50px;
    width:80px;
    height:40px;
    -webkit-transform: rotate3d(1,0,0,-55deg) rotate3d(0,0,1,30deg);
}
.block .part
{
    background:#444; /* GREY */
    width:inherit;
    height:inherit;
    -webkit-transform: translate3d(0,0,50px);
}
.block:hover .part
{
    -webkit-transform: translate3d(10px,10px,20px); /* ONLY TRANSFORMS X & Y */
}

HTML

<div class="block">
    <div class="part"></div>
</div>

Check out this Fiddle for the live example.

As you can see, the translation on :hover only affects the .part on the x- and y-axis.

It won't translate in the z-direction.

Anyone who knows what I'm doing wrong?

도움이 되었습니까?

해결책

Got it. Forgot to add -webkit-transform-style: preserve-3d;

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top