<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="../assets//normalize.css">
<style>
body{
width: 100vw;
height: 100vh;
background-image: url("../public/images/1.png");
background-position: center center;
background-size: cover;
background-repeat: no-repeat;
}
.box{
width: 300px;
height: 300px;
margin: 0 auto;
// 必须加透明背景
background-color: rgba(255, 255, 255, 0.4);
// backdrop-filter添加背景模糊,blur为高斯模糊滤镜
backdrop-filter: blur(20px);
}
</style>
</head>
<body>
<div class="box"></div>
</body>
</html>
效果如下:
Q.E.D.