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>
.box {
width: 100px;
height: 200px;
background-color: red;
margin: 100px auto;
//关键代码
transform: skew(0deg, -24deg);
}
</style>
</head>
<body>
<div class="box">平形四边形</div>
</body>
</html>
效果图
平行四边形效果图