您的位置:首页 > Web前端 > CSS

使用CSS绘制三角形

2017-10-30 18:52 288 查看
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;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: