<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>三角形</title>
<style>
.box {
width: 0;
height: 0;
border-top: 20px solid #333;
border-left: 20px solid transparent;
border-right: 20px solid transparent;
}
.top {
width: 0;
height: 0;
border-bottom: 20px solid #333;
border-left: 20px solid transparent;
border-right: 20px solid transparent;
}
.left {
width: 0;
height: 0;
border-right: 20px solid #333;
border-top: 20px solid transparent;
border-bottom: 20px solid transparent;
}
.right {
width: 0;
height: 0;
border-left: 20px solid #333;
border-top: 20px solid transparent;
border-bottom: 20px solid transparent;
}
</style>
</head>
<body>
<div class="box">
<!-- 边框的颜色是三角形的颜色。 三角形尖端点的边对应于相反的border-*属性。 例如, border-top的颜色表示箭头指向下方。
px值来改变三角形的比例。 -->
</div>
<div class="top"></div>
<div class="left"></div>
<div class="right"></div>
</body>
</html>
网友评论