<body> <article class="viewport">
<section class="cube">
<div>
<div class="part psm"><span data-href="#test">C1a</span></div>
<div class="part rm"> <span data-href="#test">C1b</span></div>
<div class="part ims" style="background: #f0e200;"><span data-href="#test">C1c</span></div>
<div class="part bsm"><span data-href="#test">C1d</span></div>
</div>
<div>
<div class="part ims" style="background: #f0e200;"><span data-href="#test">C2a</span></div>
<div class="part bsm"><span data-href="#test">C2b</span></div>
<div class="part pm"> <span data-href="#test">C2c</span></div>
<div class="part um"> <span data-href="#test">C2d</span></div>
</div>
<div>
<div class="part bsm"><span data-href="#test">C3a</span></div>
<div class="part rm"> <span data-href="#test">C3b</span></div>
<div class="part um"> <span data-href="#test">C3c</span></div>
<div class="part" style="background:#00a070;"><span data-href="#test">C3d</span></div>
</div>
<div>
<div class="part rm"> <span data-href="#test">C4a</span></div>
<div class="part psm"><span data-href="#test">C4b</span></div>
<div class="part" style="background:#00a070;"><span data-href="#test">C4c</span></div>
<div class="part qm"> <span data-href="#test">C4d</span></div>
</div>
<div>
<div class="part psm"><span data-href="#test">C5a</span></div>
<div class="part ims" style="background: #f0e200;"><span data-href="#test">C5b</span></div>
<div class="part qm"> <span data-href="#test">C5c</span></div>
<div class="part pm"> <span data-href="#test">C5d</span></div>
</div>
<div>
<div class="part qm"><span data-href="#test">C6a</span></div>
<div class="part pm"><span data-href="#test">C6b</span></div>
<div class="part" style="background:#00a070;"><span data-href="#test">C6c</span></div>
<div class="part um"><span data-href="#test">C6d</span></div>
</div>
</section>
CSS
body{
background:#fff;
}
span{
margin: 90px 0 0 20px;
font-size:40px;
float: left;
line-height: 35px;
text-decoration: none;
color:#fff;
}
.ims > span{
font-size:125px;
margin: 120px 0px 0px 25px;
text-align: center;
float: left;
font-weight: bold;
text-decoration: none;
color:#00a070;
}
.part{
background: #00a070;
width:275px;
height:275px;
float:left;
margin:10px;
font-family: Arial;
cursor: pointer;
user-select: none;
}
.viewport {
perspective: 1300px;
-webkit-perspective: 1300px;
perspective-origin: 50% 0px;
-webkit-perspective-origin: 50% 0px;
transform: scale(0.45,0.45);
-webkit-transform: scale(0.45,0.45);
-ms-transform: scale(0.45,0.45);
}
.cube {
margin: 0 auto;
height: 600px;
width: 600px;
transition: transform 50ms linear;
-webkit-transition: transform 50ms linear;
transform-style: preserve-3d;
-webkit-transform-style: preserve-3d;
transform: rotateX(-25deg) rotateY(45deg);
-ms-transform: rotateX(-25deg) rotateY(45deg);
-webkit-transform: rotateX(-25deg) rotateY(45deg);
}
.cube > div {
position: absolute;
height: 592px;
width: 592px;
padding: 5px;
background-color: #fff;
color: #fff;
}
.cube > div:first-child {
transform: rotateX(90deg) translateZ(300px);
-webkit-transform: rotateX(90deg) translateZ(300px);
-ms-transform: rotateX(90deg) translateZ(300px);
}
.cube > div:nth-child(2) {
transform: translateZ(300px);
-webkit-transform: translateZ(300px);
-ms-transform: translateZ(300px);
}
.cube > div:nth-child(3) {
transform: rotateY(90deg) translateZ(300px);
-webkit-transform: rotateY(90deg) translateZ(300px);
-ms-transform: rotateY(90deg) translateZ(300px);
}
.cube > div:nth-child(4) {
transform: rotateY(180deg) translateZ(300px);
-webkit-transform: rotateY(180deg) translateZ(300px);
-ms-transform: rotateY(180deg) translateZ(300px);
}
.cube > div:nth-child(5) {
transform: rotateY(-90deg) translateZ(300px);
-webkit-transform: rotateY(-90deg) translateZ(300px);
-ms-transform: rotateY(-90deg) translateZ(300px);
}
.cube > div:nth-child(6) {
transform: rotateX(-90deg) rotate(270deg) translateZ(300px);
-webkit-transform: rotateX(-90deg) rotate(270deg) translateZ(300px);
-ms-transform: rotateX(-90deg) rotate(270deg) translateZ(300px);
}
这是适用于 chrome 和 safari 但不适用于 IE10 的 3d-cube 代码。我发现 Transform-style:presev-3d, preservative:1300px,preservative-origin:50% 300px; 不适用于 IE10。任何像这样在 IE10 中工作的解决方案或替代属性?
请查看 JsFiddle 链接并帮助我。jsfiddle 谢谢谢什