【发布时间】:2016-05-13 23:37:11
【问题描述】:
我有一个代码可以翻转到一个 div。它在 Firefox 和 Chrome 中运行良好,但在 IE 中,当卡片翻转时,它会显示正面颠倒而不是显示背面。
这是代码:
body {
background: #eee;
}
.card{
width: 300px;
height: 300px;
}
.content {
width: 300px;
height: 300px;
perspective: 500px;
box-shadow: 0 0 15px rgba(0,0,0,0.1);
transition: transform 1s;
transform-style: preserve-3d;
}
.card:hover .content {
transform: rotateX( 180deg ) ;
transition: transform 0.5s;
}
.front,
.back {
position: absolute;
height: 100%;
width: 100%;
background: white;
line-height: 300px;
color: #03446A;
text-align: center;
font-size: 60px;
border-radius: 5px;
backface-visibility: hidden;
}
.back {
background: #03446A;
color: white;
transform: rotateX( 180deg );
}
<div class="card">
<div class="content">
<div class="front">
Front
</div>
<div class="back">
Back!
</div>
</div>
</div>
【问题讨论】:
-
哪个版本的 Internet Explorer?
-
IE11 不支持
transform-style:preserve-3d。见caniuse.com/#feat=transforms3d