我在卡的正面添加了backface-visibility属性,但在FireFox中,它仍显示卡的背面。在这里看到:http://jsfiddle.net/AZSLB/
这是我的CSS:
.flip {
-webkit-perspective: 800;
-moz-perspective: 800;
-ms-perspective: 800;
perspective: 800;
position: relative;
}
.flip .card.flipped {
-webkit-transform: rotatey(-180deg);
-moz-transform: rotatey(-180deg);
-ms-transform: rotatey(-180deg);
-o-transform: rotatey(-180deg);
transform: rotatey(-180deg);
}
.flip .card {
width: 100%;
height: 100%;
-webkit-transform-style: preserve-3d;
-moz-transform-style: preserve-3d;
-ms-transform-style: preserve-3d;
transform-style: preserve-3d;
-webkit-transition: 0.5s;
-moz-transition: 0.5s;
-ms-transition: 0.5s;
-o-transition: 0.5s;
transition: 0.5s;
}
.flip .card .face {
width: 100%;
height: 100%;
position: absolute;
z-index: 2;
text-align: center;
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
-ms-backface-visibility: hidden;
backface-visibility: hidden;
}
.flip .card .front {
position: absolute;
z-index: 1;
color: white;
cursor: pointer;
}
.flip .card .back {
-webkit-transform: rotatey(-180deg);
background: #FFF url("<?php echo $dirUrl; ?>/assets/img/photo-bg.jpg");
color: #222;
cursor: pointer;
}
.flip .card .back p {
font-size: 15px;
padding: 10px 20px;
position: absolute;
height: auto;
width: auto;
top: 50%;
left: 0;
-webkit-transform: translate(0%, -50%);
-moz-transform: translate(0%, -50%);
-ms-transform: translate(0%, -50%);
-o-transform: translate(0%, -50%);
transform: translate(0%, -50%);
}
有任何想法吗?谢谢!
最佳答案
这种风格
.flip .card .back {
-webkit-transform: rotatey(-180deg);
background: #FFF url("<?php echo $dirUrl; ?>/assets/img/photo-bg.jpg");
color: #222;
cursor: pointer;
}
缺少未前缀的转换
关于css - FireFox背面不起作用,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/23447375/