html
<div class="img-box"> <div class="img"></div> <div class="img-bg"></div> </div>
css
.img-box { width: 100%; height: 212px; .img { background-position: center; background-repeat: no-repeat; background-size: contain; background-image: url('test.png'); } .img-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-image: url('test.png'); background-size: 200%; /* 放大两倍 */ background-position: center; background-repeat: no-repeat; overflow: hidden; } .img-bg::before { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.6); /* 60%不透明度的黑色 */ z-index: 1; /* 确保蒙层在背景之上 */ backdrop-filter: blur(20px); /* 添加20模糊效果 */ }
标签:repeat,img,100%,height,130%,background,position,虚化,图片 From: https://www.cnblogs.com/beileixinqing/p/18335085