设置父盒子为相对定位,一个是虚化的背景盒子,一个是虚化背景之上的内容
.swiper-box {
position: relative;
height: 400upx;
width: 100%;
.swiper {
position: absolute;
width: 100%;
height: 400upx;
background-repeat: no-repeat;
background-size:contain;
left: 0px;
top: 0px;
-webkit-filter: blur(15upx);
-moz-filter: blur(15upx);
-o-filter: blur(15upx);
-ms-filter: blur(15upx);
filter: blur(6upx);
}
.img-box {
position: absolute;
z-index: 5;
left: 0;
right: 0;
top: 0;
bottom: 0;
margin:auto;
display: block;
height: 400upx;
}