CSS3 3D Transform doesn't work on IE11

前端 未结 1 556
离开以前
离开以前 2020-12-01 23:55

I\'m trying to build a cube with CSS3 3D Transform..

For this example I have only 2 faces :

1条回答
  •  无人及你
    2020-12-02 00:41

    IE doesn't support transform-style: preserve-3d yet.

    You have to remove the transform from #header-cube and apply it to each of the figure children. Unfortunately IE already uses the non-prefixed properties, so you either can't use transform-3d at all or have to define the prefixed properties last.

    From the IE transforms documentation:

    At this time, Internet Explorer 10 does not support the preserve-3d keyword. You can work around this by manually applying the parent element's transform to each of the child elements in addition to the child element's normal transform.

    JSFiddle: http://jsfiddle.net/TTDH7/17/

    #header-cube {
        transform-style: preserve-3d;
        transform: rotateX(43deg) rotateZ(130deg);
    }
    figure:nth-child(1) {
        transform: translateZ(-16px);
    }
    figure:nth-child(2) {
        transform: rotateY(-100deg) translateZ(-16px);
    }
    

    becomes:

    #header-cube {
        transform-style: preserve-3d;
        -ms-transform-style: none;
        transform: rotateX(43deg) rotateZ(130deg);
        -ms-transform: none;
    }
    figure:nth-child(1) {
        transform: translateZ(-16px);
        -ms-transform: rotateX(43deg) rotateZ(130deg)
                       translateZ(-16px);
    }
    figure:nth-child(2) {
        transform: rotateY(-100deg) translateZ(-16px);
        -ms-transform: rotateX(43deg) rotateZ(130deg)
                       rotateY(-100deg) translateZ(-16px);
    }
    

    0 讨论(0)
提交回复
热议问题