代码如下
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>箭头</title>
<style type="text/css">
.arrow {
width: 20px;
height: 20px;
border-top: 1px solid #000;
border-left: 1px solid #000;
/*background: pink;*/
transform: rotate(45deg);
margin-top: 50px;
margin-left: 50px;
}
.triangle{
width:0;
height: 0;
border-width: 100px;
border-style: solid;
border-color: transparent transparent transparent seagreen;
}
.outset{
width: 300px;
height: 300px;
background: cadetblue;
/*padding-top: 20px;*/
overflow: hidden;
}
.inner{
width: 200px;
height: 200px;
background: yellow;
margin-top: 20px;
/*overflow: hidden;*/
/*margin-top: 20px;*/
}
</style>
</head>
<body>
<!-- 箭头-->
<div class="arrow">
</div>
<!-- 小三角-->
<div class="triangle"></div>
<div class="outset">
<div class="inner"></div>
</div>
</body>
</html>