I am trying to use CSS 3D transforms to display cubes and cuboids that will contain cross sections. I focus on Chrome, Firefox and MSIE 11. I found that to support MSIE 11 compatibility, I need to avoid using transform-type: preserve-3d, since this is not supported by Microsoft, so I need to apply all the parent and child transforms to each face of the cube .
For a cube, I can rotate each side to align them correctly, but for a cuboid, the ends are offset - why is this and how can I fix it?
This screenshot illustrates the problem:

Here is the HTML:
<div class="test test1">
<h1>1.</h1>
<div class="cube">
<div class="side front">1</div>
<div class="side back">6</div>
<div class="side right">4</div>
<div class="side left">3</div>
<div class="side top">5</div>
<div class="side bottom">2</div>
</div>
</div>
<div class="test test2">
<h1>2.</h1>
<div class="cube cuboid">
<div class="side front">1</div>
<div class="side back">6</div>
<div class="side right">4</div>
<div class="side left">3</div>
<div class="side top">5</div>
<div class="side bottom">2</div>
</div>
</div>
and here is the CSS:
div.test {
height: 200px;
}
.cube {
font-size: 4em;
width: 500px;
margin: auto;
}
.side {
position: absolute;
width: 100px;
height: 100px;
background: rgba(255,0,0,0.3);
border: 1px solid black;
color: white;
text-align: center;
line-height: 100px;
}
.front {
transform: rotateX(-40deg) rotateY(32deg) translateZ(50px);
z-index: 1000;
}
.top {
transform: rotateX(-40deg) rotateY(32deg) rotateX(90deg) translateZ(50px);
z-index: 1000;
}
.right {
transform: rotateX(-40deg) rotateY(32deg) rotateY(90deg) translateZ(50px);
}
.left {
transform: rotateX(-40deg) rotateY(32deg) rotateY(-90deg) translateZ(50px);
z-index: 1000;
}
.bottom {
transform: rotateX(-40deg) rotateY(32deg) rotateX(-90deg) translateZ(50px);
}
.back {
transform: rotateX(-40deg) rotateY(-148deg) translateZ(50px);
}
.cuboid .front {
width: 200px;
}
.cuboid .top {
width: 200px;
}
.cuboid .right {
transform: rotateX(-40deg) rotateY(122deg) translateZ(150px);
}
.cuboid .back {
width: 200px;
}
.cuboid .bottom {
width: 200px;
}
Here is the JSFiddle of this code: https://jsfiddle.net/6h7mmtgn/
Thanks for any suggestions.