• css border实现三角形


    实现过程:

    正常的border

    <div class="box"></div>
    .box {
         background: #ddd;
          100px;
         height: 100px;
         border-top: 20px solid yellow;
         border-right: 20px solid red;
         border-bottom: 20px solid black;
         border-left: 20px solid blue;
    }

    高度和宽度减小后的border

    正常border表现为梯形,当box的高度和宽度减小至0时,border则为三角形

    .box {
            background: #ddd;
             0;
            border-top: 20px solid yellow;
            border-right: 20px solid red;
            border-bottom: 20px solid black;
            border-left: 20px solid blue;
    }

    接下通过设置其他三个border的背景为透明则可以实现三角形

    .box {
             0;
            border-top: 20px solid yellow;
            border-right: 20px solid transparent;
            border-bottom: 20px solid transparent;
            border-left: 20px solid transparent;
    }

    .box {
             0;
            border-top: 20px solid transparent;
            border-right: 20px solid red;
            border-bottom: 20px solid transparent;
            border-left: 20px solid transparent;
    }

    .box {
             0;
            border-top: 20px solid transparent;
            border-right: 20px solid transparent;
            border-bottom: 20px solid black;
            border-left: 20px solid transparent;
    }

    .box {
             0;
            border-top: 20px solid transparent;
            border-right: 20px solid transparent;
            border-bottom: 20px solid transparent;
            border-left: 20px solid blue;
    }

    参考:https://www.cnblogs.com/youhong/p/6530575.html

  • 相关阅读:
    数据特征分析:5.相关性分析
    数据特征分析:4.正态分布与正态性检验
    go-文件操作
    图-迪杰斯特拉算法
    图-克鲁斯卡尔算法
    图-普利姆算法
    go-客户信息关系系统
    go-家庭收支记账软件例子
    采用邻接表表示图的深度优先搜索遍历
    广度优先搜索遍历连通图
  • 原文地址:https://www.cnblogs.com/bear-blogs/p/10261917.html
Copyright © 2020-2023  润新知