首页 > Web开发 > 详细

css实现三角形相关

时间:2019-04-01 20:45:36      阅读:133      评论:0      收藏:0      [点我收藏+]
1.css样式面包屑导航条实现矩形和三角箭头拼接
.cssTest {
    font-family: PingFangSC-Regular;
    font-size: 16px;
    color: #333333;
    line-height: 40px;
    /* 左侧部分 */
    .cssTest1 {
        width: 750px;
        height: 40px;
        background-color: #D3D8DF;
        position: relative;
        display: inline-block;
    }
    .cssTest1:after {
        content: ‘‘;
        width: 0px;
        height: 0px;
        border-top: 20px solid rgba(255, 255, 255, 0);
        border-right: 20px solid rgba(255, 255, 255, 0);
        border-bottom: 20px solid rgba(255, 255, 255, 0);
        border-left: 20px solid #D3D8DF;
        left: 750px;
        position: absolute;
        z-index: 99;
    }
    .cssTest2 {
        width: 750px;
        height: 40px;
        background-color: #87AAD2;
        position: relative;
        display: inline-block;
        left: 50px;
    }
    .cssTest2:before {
        content: ‘‘;
        width: 0px;
        height: 0px;
        border-top: 20px solid #87AAD2;
        ;
        border-right: 20px solid #87AAD2;
        ;
        border-bottom: 20px solid #87AAD2;
        ;
        border-left: 20px solid rgba(255, 255, 255, 0);
        position: absolute;
        right: 750px;
    }
}

2.画三角形的右上部分
<div class="example-content-image-status status-mutual"></div>
.example-content-image-status {
    z-index: 2;
    width: 0;
    height: 0;
    position: absolute;
    border-bottom: 1.875rem solid rgba(255, 255, 255, 0);
    border-left: 3.125rem solid rgba(255, 255, 255, 0);
    border-top: 1.875rem solid rgba(255, 255, 255, 0);
    border-right: 3.125rem solid rgba(255, 255, 255, 0);
    right: 0;
}
.status-mutual {
    border-top: 1.875rem solid #919191;
    border-right: 3.125rem solid #919191;
}

 

css实现三角形相关

原文:https://www.cnblogs.com/lskzj/p/10638472.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!