CSS三维倾斜
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
/* 一定要给父元素设置井深 */
.container {
perspective: 800px;
perspective-origin: 100px 100px;
}
.box {
width: 100px;
height: 200px;
background-color: #0ff;
transform-style: preserve-3d;
transform : rotateY(30deg);
}
</style>
</head>
<body>
<div class="container">
<div class="box">
<img src="https://gimg3.baidu.com/search/src=http%3A%2F%2Fpics4.baidu.com%2Ffeed%2F4610b912c8fcc3ce4eaca9a0af3a7d82d53f20ba.jpeg%3Ftoken%3Da1b53adbfd73105ea889189a37104fae&refer=http%3A%2F%2Fwww.baidu.com&app=2021&size=f360,240&n=0&g=0n&q=75&fmt=auto?sec=1658422800&t=d1adbae67f85650b8bd45ad2dada1b23" alt="">
</div>
</div>
</body>
</html>
效果: