首页背景虚化
//html
<div class="index"></div>
<div class="index2">
111
</div>
//css
.index {
position: fixed;
width: 100%;
height: 100%;
top: 0px;
/*放置背景图*/
background-image: url(../assets/bacImg.jpg);
/*设置背景图大小*/
background-size: 100% 100%;
}
.index2 {
position: fixed;
width: 100%;
height: 100%;
top: 0px;
/*放置背景图*/
background-image: url(../assets/bacImg.jpg);
/*设置背景图大小*/
background-size: 100% 100%;
/*虚化背景图*/
filter: blur(1px);
color: white;
background-color: #000000;
}
.divView {
width: 300px;
height: 300px;
background-color: red;
margin: 100px auto;
}