html小三角
<!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: 0;
height: 0;
border: 50px solid transparent;
border-left: 50px solid pink;
}
.sanjiao {
position: relative;
width: 200px;
height: 200px;
background-color: antiquewhite;
}
span {
position: absolute;
/* border-width的两倍; */
top: -20px;
right: 15px;
width: 0;
height: 0;
font-size: 0;
line-height: 0;
border: 10px solid transparent;
border-bottom-color: red;
}
</style>
</head>
<body>
<div class="box"></div>
<div class="sanjiao">
<span></span>
</div>
</body>
</html>