绘制三角形
当盒子内容的宽度和高度远小于边框的时候,边框的显示为等腰梯形。由此我们可以推断,当我们将 div 的宽高都设为 0 的时候,代表盒子内容的白色正方形会消失,于此同时,边框显示为等腰三角形。
<div class="test"></div>
<style>
.test {
width: 0px;
height: 0px;
border-top: 50px solid black;
border-right: 50px solid transparent;
border-bottom: 50px solid transparent;
border-left: 50px solid transparent;
}
</style>