1、效果图
2、代码
<!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>
.one {
/* 设置div宽高 */
width: 0;
height: 0;
/* transparent——透明 */
border: 100px solid transparent;
/* 设置下边框 */
border-bottom: 100px solid plum;
}
</style>
</head>
<body>
<div class="one"></div>
</body>
</html>
原理:边框是以border的100px为高、内容的width或heigth组成的形状
当width、height=0时&#x