在设置背景的类样式中设置filter: blur(模糊值),如:filter: blur(5px)
/* 模糊背景图片 */
#workShow .imgItem {
width: 100%;
height: 270px;
position: relative;
/* border-bottom: 1px solid red; */
}
#workShow .imgItem::before {
width: 100%;
height: 270px;
filter: blur(5px);
content: "";
position: absolute;
top: 0;
left: 0;
background-image: url("../../assets/hang.jpg");
background-size: 100% 98%;
background-repeat: no-repeat;
}
如果文章对你有帮助,麻烦点个赞,谢谢~