为背景图添加遮罩效果
目录
css:.wrap{ position: relative; background: url(i/pic4.jpg) no-repeat; -webkit-background-size: 100%; background-size: 100%; } .wrap-mask:after{ position: absolute; top: 0; left: 0; content: ""; background-color: #333; opacity: 0.3; z-index: 1; width: 100%; height: 100%; } html: <div class="wrap"> <div class="wrap-mask"></div> </div>