css3 景深

<!DOCTYPE html>
<html>
<head>
<title>景深</title>
<meta charset="utf-8">
<style type="text/css">
.box{
400px;
height: 400px;
margin: 100px auto;
position: relative;
transform-style: preserve-3d;
/*景深相当于眼睛距离元素的位置距离*/
perspective: 100px;
/*眼睛距元素的偏移位置*/
perspective-origin: 10px 100px;
}
img{
150px;
height: 200px;
position: absolute;
left: 0;
right: 0;
bottom: 0;
top: 0;
margin: auto;
transform: rotateX(50deg);
}
</style>
</head>
<body>
<div class="box">
<img src="img/dameizi.jpeg">
</div>
</body>
</html>

原文地址:https://www.cnblogs.com/adialike/p/6388938.html