code:
<!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: 200px;
margin: 0 auto;
margin-top: 20vh;
}
.box1 {
width: 0;
height: 0;
border-top: 100px solid pink;
border-right: 100px solid green;
border-bottom: 100px solid blue;
border-left: 100px solid red;
}
.box2 {
width: 0;
height: 0;
border: 100px solid transparent;
border-bottom: 100px solid pink;
margin-top: 20px;
}
</style>
</head>
<body>
<div class="box">
<div class="box1"></div>
<div class="box2"></div>
</div>
</body>
</html>
效果图: