CSS blur on background image but not on content

前端 未结 5 2125
予麋鹿
予麋鹿 2020-11-27 06:21

I did this example.

I\'m trying to blur the background image, but the main content is blurred too (the )

How can I blur the backgrou

5条回答
  •  情书的邮戳
    2020-11-27 06:59

    Add another div or img to your main div and blur that instead. jsfiddle

    .blur {
        background:url('http://i0.kym-cdn.com/photos/images/original/000/051/726/17-i-lol.jpg?1318992465') no-repeat center;
        background-size:cover;
        -webkit-filter: blur(13px);
        -moz-filter: blur(13px);
        -o-filter: blur(13px);
        -ms-filter: blur(13px);
        filter: blur(13px);
        position:absolute;
        width:100%;
        height:100%;
    }
    

提交回复
热议问题