<body>
<div class="content">
毛玻璃效果毛玻璃效果毛玻璃效果毛玻璃效果毛玻璃效果毛玻璃效果毛玻璃效果毛玻璃效果毛玻璃效果毛玻璃效果
</div>
</body>
<style>
body {
background: url("https://www.diablo3.cn/d/file/yxgl/yxgl/2020-01-08/50f202f0fc045dc8028246de53d9dc62.png") center center / cover no-repeat fixed;
width: 100%;
height: 100%;
padding: 0;
margin: 0;
}
.content {
height: 400px;
width: 600px;
word-break: break-all;
z-index: 10;
position: absolute;
top: 50%;
left: 50%;
margin-top: -200px;
margin-left: -300px; /*不能用transform: translate(-50%, -50%)来代替,否则效果不是我们想要的,目前不知原因。*/
overflow: hidden; /* 为防止效果不超出 content 的范围*/
}
.content:before {
content: '';
background: url("https://www.diablo3.cn/d/file/yxgl/yxgl/2020-01-08/50f202f0fc045dc8028246de53d9dc62.png") center center / cover no-repeat fixed;
filter: blur(20px);
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
z-index: -1;
margin: -30px; /*为解决元素的边缘模糊的效果减弱*/
}
</style>
