css 实现毛玻璃效果

711 阅读1分钟
<!--
 * @Description: 
 * @Author: liudong
 * @Date: 2022-02-09 11:00:26
 * @LastEditTime: 2022-02-09 11:05:46
 * @LastEditors: liudong
-->
<!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>
    <style>
        body{
            background-color: pink;
        }
        .box{
            width: 200px;
            height: 200px;
            background-image: linear-gradient(to bottom right, rgba(255,255,255,.2),rgba(255,255,255,0));
            backdrop-filter: "blur(10px)";
            box-shadow: 10px 10px 10px rgba(30,30,30,.5);
            margin: 100px auto 0;
        }
    </style>
</head>
<body>
    <div class="box"></div>
</body>
</html>
```
`