<div class="transform">42.48%</div>
//转化
.transform {
position: relative;
width: 70px;
height: 26px;
background-color: #dcdfe6; /* 长方形的颜色 */
display: flex;
justify-content: center;
align-items: center;
font-family: PingFangTC-Medium;
font-weight: 500;
font-size: 14px;
color: #303133;
}
.transform::after {
content: "";
position: absolute;
top: 26px; /* 三角形位于长方形下方 */
left: 0px;
width: 0;
height: 0;
border-left: 35px solid transparent;
border-right: 35px solid transparent;
border-top: 6px solid #dcdfe6;
}
参考:
纯CSS画基本图形(矩形、圆形、三角形、多边形、爱心..)_css结构框图怎么画-CSDN博客