1、元素使用了背景色且透明度,伪元素覆盖不了
.all-alarm {
color: #fff;
background: #1890FC;
opacity: 0.6;
&::before {
content: "";
left: 0px;
top: 0px;
position: absolute;
width: 3px;
height: 0.38rem;
background: #1890FC;
opacity: 1;
}
}
2、修改成使用rgba
.all-alarm {
color: #fff;
background: rgba(24, 144, 252, .6);
&::before {
content: "";
left: 0px;
top: 0px;
position: absolute;
width: 3px;
height: 0.38rem;
background: #1890FC;
}
}