1. 用 css 画三角形
.triangle {
width: 0;
height: 0;
border-width: 100px;
border-style: solid;
border-color: tomato transparent transparent transparent; //3边透明,一边不透明
}
技巧--记住透明边框的数量:3点一线
(总共 4 条线,有 3 条变成点了,即变透明了,另外一条边还是线,即不透明)
.triangle {
width: 0;
height: 0;
border-width: 100px;
border-style: solid;
border-color: tomato transparent transparent transparent; //3边透明,一边不透明
}
技巧--记住透明边框的数量:3点一线
(总共 4 条线,有 3 条变成点了,即变透明了,另外一条边还是线,即不透明)