CSS三角形绘制
思路
- 让宽高为0。(eg:width:0;eheight:0)
- 让边框变大。(eg:border:100px solid;)
- 让边框的其他三边为透明 transparent。代码如下:
#tup{
height: 0px;
width: 0px;
border: 100px solid;
border-top-color: transparent;
border-bottom-color: red;
border-left-color: transparent;
border-right-color: transparent;
}
效果图如下: