好奇怪啊?为啥我翻转之后,就直接变成了一块黑
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style type="text/css">
*{
padding: 0;margin: 0;
}
body{
background-color: #fff;
color: #555;
font-family: "微软雅黑";
font-size: 14px;
font-smoothing:amtialiased;
}
.wrap{
width: 100%;
height: 600px;
position: absolute;
top: 50%;
margin-top: -300px; /*完成了垂直居中*/
background-color: #333;
overflow: hidden;
perspective: 800px;/*制造出一个3d的效果*/
}
/*海报样式*/
.photo{
width: 260px;
height: 320px;
position: absolute;
z-index: 1;
box-shadow: 0 0 1px rgba(0,0,0,.01);
}
.photo .side{
width: 100%;
height: 100%;
background-color: #eee;
position: absolute;
top: 0;
right: 0;
padding: 20px;
box-sizing: border-box;
}
.photo .side-front{
}
.photo .side-front .image{
width: 100%;
height: 250px;
line-height: 250px;
overflow: hidden;
}
.photo .side-front .image img{
width: 100%;
}
.photo .side-front .caption{
text-align: center;
font-size: 16px;
line-height: 50px;
}
.photo .side-back{
}
.photo .side-back .desc{
color: #666;
font-size: 14px;
line-height: 1.5em;
}
/*当前选择的海报样式*/
.photo_center{
left: 50%;
top:50%;
margin: -160px 0 0 -130px;
z-index: 999;
/* 设置水平,垂直居中的方法:
position: absolute;
left:50%
top:50%;
margin-left:-130px; 设置为宽度的一半
margin-top:-160px; 设置为高度的一半
*/
}
/*负责翻转*/
.photo-wrap{
position: absolute;
width: 100%;
height: 100%;
transform-style:preserve-3d;
transition: all 0.6s;
}
.photo-wrap .side-front{
transform: rotateY(0deg);
}
.photo-wrap .side-back{
transform: rotateY(180deg);
}
.photo-wrap .side{
backface-visibility: hidden;
}
.photo_front .photo-wrap{
transform: rotateY(0deg);
}
.photo_back .photo-wrap{
transform: rotateY(180deg);
}
</style>
</head>
<body onselectstart="return false;">
<div class="wrap">
<!-- photo 负责平移,旋转 -->
<div class="photo photo_center">
<!-- photo-wrap 负责翻转 -->
<div class="photo-wrap">
<div class="side side-front">
<p ckass="image"><img src="test.jpeg" style="height: 300px;"/></p>
<p class="caption">麦兜我和我妈妈</p>
</div>
<div class="side side-back">
<p class="desc">描述信息</p>
</div>
</div>
</div>
</div>
</body>
</html>