<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>3D变形案例2</title>
<style type="text/css">
* {
margin: 0;
padding: 0;
}
.wrap {
width: 310px;
height: 100px;
margin: 100px auto;
perspective: 2000px;
}
.item {
width: 100%;
height: 100%;
position: relative;
transform-style: preserve-3d;
transition: 1s;
}
.item img {
position: absolute;
border-radius: 5px;
width: 310px;
height: 100px;
transform: translateZ(50px);
}
.item span {
width: 290px;
height: 80px;
padding: 10px;
position: absolute;
left: 0;
top: 0;
background: #ccc;
border-radius: 5px;
transform: rotateX(-90deg) translateZ(50px);
/* transform-origin: bottom; */
}
.item:hover {
transform: rotateX(90deg);
}
</style>
</head>
<body>
<div class="wrap">
<div class="item">
<img alt="" src="img/狮子.jpg" />
<span>This is lion!This is lion!This is lion!This is lion!This is lion!This is lion!This is lion!
This is lion!This is lion!This is lion!This is lion!This is lion!</span>
</div>
</div>
</body>
</html>