站内搜索:
首页 >> 前端 >> 内容
使用CSS绘制三角形原理

时间:2017/10/31 15:19:48

1.三角形朝上

.triangle-up {

width: 0;
height: 0;
border-left: 10px solid transparent;
border-right: 10px solid transparent;
border-bottom: 10px solid #188ae2;

}

2.三角形朝下

.triangle-down {
width: 0;
height: 0;
border-left: 10px solid transparent;
border-right:10px solid transparent;
border-top: 10px solid #188ae2;
}

3.三角形朝左

.triangle-left {
width: 0;
height: 0;
border-top: 50px solid transparent;
border-right: 100px solid #188ae2;
border-bottom: 50px solid transparent;
}

4.三角形朝右

.triangle-right {
width: 0;
height: 0;
border-top: 10px solid transparent;
border-left: 10px solid #188ae2;
border-bottom: 10px solid transparent;
}

5.三角形朝左上

.triangle-topleft {
width: 0;
height: 0;
border-top: 10px solid #188ae2;
border-right: 10px solid transparent;
}

6.三角形朝右上

.triangle-topright {
width: 0;
height: 0;
border-top: 10px solid #188ae2;
border-left: 10px solid transparent;
}

7.三角形朝左下

.triangle-bottomleft {
width: 0;
height: 0;
border-bottom: 10px solid #188ae2;
border-right: 10px solid transparent;
}

8.三角形朝右下

.triangle-bottomright {
width: 0;
height: 0;
border-bottom: 100px solid #188ae2;
border-left: 100px solid transparent;
}

  • 上一篇:HTML字符实体、不间断空格
  • 下一篇:前端五种清除浮动的方法
  • 返回顶部