一、各种三角形的画法
(1)三角形
.triangle1 {
width: 0;
height: 0;
/* 去掉空白区域 */
/* border-top: 50px solid transparent; */
border-bottom: 50px solid green;
border-left: 50px solid transparent;
border-right: 50px solid transparent;
}
(2)等边三角形
.triangle2 {
width: 0;
height: 0;
/* 思考这里的86.6是怎么来的 */
/* border-top: 86.6px solid transparent; */
border-bottom: 86.6px solid orange;
border-left: 50px solid transparent;
border-right: 50px solid transparent;
}
(3)梯形
.triangle2 {
width: 100px;
height: 100px;
/* border-top: 86.6px solid transparent; */
border-bottom: 86.6px solid orange;
border-left: 50px solid transparent;
border-right: 50px solid transparent;
}