Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS3 3D Transform doesn't work on IE11

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

For this example I have only 2 faces :

<section id="header-cube-container">
    <div id="header-cube">
        <figure></figure>
        <figure></figure>
    </div>
</section>

With every other browser I get a good result, but it's weird with IE 11.

I have a good 3D translate and rotate on the green face (1), but the red face (2) perpendicular doesn't display in 3D. It's only the projection of the red face on the green face.

Result on Chrome and IE

You can see the result on this fiddle.

PS : I make a rotation of 100deg and not 90 to see the projection of the red face on the green face (if the angle was 90, the projection isn't visible).

Thank you all!

like image 487
Arthur Avatar asked Apr 03 '14 20:04

Arthur


People also ask

Does CSS support 3D Transforms?

CSS also supports 3D transformations. Mouse over the elements below to see the difference between a 2D and a 3D transformation: The numbers in the table specify the first browser version that fully supports the property. With the CSS transform property you can use the following 3D transformation methods:

Does CSS work in IE11?

I followed everything exactly but the CSS file simply won’t work in IE11. I downloaded Google Chrome and it works like a champ. I’ve run both the HTML5 and CSS through validators and everything comes up shiny!

Why can't I use transform-style preserve-3d in IE?

1 Answer 1. 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.

How to use transform-3d in Internet Explorer 10?

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. At this time, Internet Explorer 10 does not support the preserve-3d keyword.


1 Answers

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);
}
like image 88
Aleksander Bavdaz Avatar answered Sep 22 '22 18:09

Aleksander Bavdaz