首先原图片效果 + 代码:
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title></title>
<style type="text/css">
.wrapper {
position: relative;
width: 100%;
height: 100vh;
overflow: hidden;
}
.wrapper::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: url(https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1603428298496&di=64640a01efa82d69fd270969ca2a8321&imgtype=0&src=http%3A%2F%2Fattach.bbs.miui.com%2Fforum%2F201405%2F31%2F124814kg76m5xeenbax6qn.jpg);
background-size: cover;
background-attachment: fixed;
}
</style>
</head>
<body>
<div class="wrapper"></div>
</body>
</html>
模糊之后 效果 + 代码:
/* before添加 */
filter: blur(20px);