<!DOCTYPE html>
<html>
<head>
<title>景深</title>
<meta charset="utf-8">
<style type="text/css">
.box{
width: 400px;
height: 400px;
margin: 100px auto;
position: relative;
transform-style: preserve-3d;
/*景深相当于眼睛距离元素的位置距离*/
perspective: 100px;
/*眼睛距元素的偏移位置*/
perspective-origin: 10px 100px;
}
img{
width: 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>

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-12
  • 2021-06-05
  • 2021-06-04
  • 2021-10-19
  • 2021-11-17
  • 2021-12-12
猜你喜欢
  • 2022-12-23
  • 2021-05-21
  • 2021-09-24
  • 2021-12-18
  • 2022-12-23
相关资源
相似解决方案