css实现三角形相关

时间:2023-12-27 08:34:49
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:;
}
.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:;
width:;
height:;
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:;
}
.status-mutual {
border-top: 1.875rem solid #919191;
border-right: 3.125rem solid #919191;
}