代码如下:
<!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>三角设计</title>
<style>
.box {
width:200px;
height:100px;
margin:20px auto;
position:relative;
}
.box1 {
width:200px;
height:100px;
background-color: rgb(240, 182, 182);
border:1px solid rgb(240, 182, 182);
}
.box2 {
width:0;
height:0;
font-size:0;
line-height:0;
position:absolute;
left:90px;
top:-40px;
}
.box2 em,.box2 ins {
width:0;
height:0;
display:block;
position:absolute;
border:20px solid transparent;
border-style:dashed dashed solid dashed;
}
.box2 em {
border-bottom-color:rgb(240, 182, 182);
}
.box2 ins {
border-bottom-color:rgb(240, 182, 182);
}
</style>
</head>
<body>
<div class="box">
<div class="box1"></div>
<div class="box2"> <em></em> <ins></ins> </div>
</div>
</body>
</html>
结果如下: