css 伪类:after实现遮罩层

text

// 蒙板
.mask-zt{
    padding: 15px;
    z-index: 2;
    position: relative;
    height: 150px;

}
.mask-zt:after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0px;
    right: 0px;
    background: rgba(0, 0, 0, 0.6);
    height: 100%;
    z-index: -1;
}

效果:

css 伪类:after实现遮罩层_第1张图片

你可能感兴趣的:(web)