css使用mask: linear-gradient() 在不同分辨率下会出现白色缝隙(放大缩小页面也会出现)
<div class="step-bar">
<div class="step-item finish">MASK</div>
<div class="step-item finish">MASK</div>
<div class="step-item finish">MASK</div>
<div class="step-item finish">MASK</div>
<div class="step-item finish">MASK</div>
<div class="step-item finish">MASK</div>
</div>
@step-mask-size: 50% 50%;
@step-mask-repeat: no-repeat;
@step-mask-transparent-width: 10px;
@step-mask-angle-top-left: 60deg;
@step-mask-angle-top-right: -120deg;
@step-mask-angle-bottom-right: -60deg;
@step-mask-angle-bottom-left: 120deg;
// 混合宏定义
.step-mask(@transparent-start: 0%, @transparent-end: 0%) {
// 添加默认值
mask: linear-gradient(@step-mask-angle-top-left, transparent @transparent-start, #fff 0) top left,
linear-gradient(@step-mask-angle-top-right, transparent @transparent-end, #fff 0) top right,
linear-gradient(@step-mask-angle-bottom-right, transparent @transparent-end, #fff 0) bottom
right,
linear-gradient(@step-mask-angle-bottom-left, transparent @transparent-start, #fff 0) bottom
left;
mask-size: @step-mask-size;
mask-repeat: @step-mask-repeat;
}
.step-bar {
display: flex;
align-items: center;
width: 100%;
height: 40px;
.step-item {
flex: 1;
height: 40px;
line-height: 40px;
font-size: 16px;
text-align: center;
position: relative;
.step-mask(@step-mask-transparent-width, @step-mask-transparent-width);
&:first-child {
.step-mask(0, @step-mask-transparent-width);
}
&:last-child {
.step-mask(@step-mask-transparent-width, 0);
}
}
}
.finish {
background-color: #e5e5e5;
color: #9b9b9b;
position: relative;
}
是什么问题,如何去掉缝隙