首页 > 代码库 > css实现背景图片模糊

css实现背景图片模糊

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        img {
            width: 300px;
            height: 300px;
        }
        .blur {    
            filter: url(blur.svg#blur); /* FireFox, Chrome, Opera */
            
            -webkit-filter: blur(10px); /* Chrome, Opera */
               -moz-filter: blur(10px);
                -ms-filter: blur(10px);    
                    filter: blur(10px);
            filter: progid:DXImageTransform.Microsoft.Blur(PixelRadius=10, MakeShadow=false); /* IE6~IE9 */
        }
    </style>
</head>
<body>
    <img src="lpt-vue/src/assets/logo.png" />
    <img src="lpt-vue/src/assets/logo.png" class="blur" />
</body>
</html>

图片是我本地的图片,建议换掉图片

css实现背景图片模糊