remove blur effect on child element

前端 未结 1 1257
隐瞒了意图╮
隐瞒了意图╮ 2020-11-27 20:59

I have a

with an background-image with blur effect.

-webkit-filter: blur(3px);
-moz-filter: blur(3px);
-o-filter: blur(3px);
-ms-fil         


        
相关标签:
1条回答
  • 2020-11-27 21:30

    Create a div inside content & give bg image & blur effect to it. & give it z-index less the the opacity div, something like this.

    <div class="content">
        <div class="overlay"></div>
        <div class="opacity">
            <div class="image">
                <img src="images/zwemmen.png" alt="" />
            </div>
            <div class="info">
                 a div wih all sort of information
            </div>
        </div>
    </div>
    

    Use Css

    .content{
        float: left;
        width: 100%;
    }
    
    .content .overlay{
        background-image: url('images/zwemmen.png');
        height: 501px;
        -webkit-filter: blur(3px);
        -moz-filter: blur(3px);
        -o-filter: blur(3px);
        -ms-filter: blur(3px);
        filter: blur(3px);
        z-index:0;
    }
    
    .opacity{
        background-color: rgba(5,98,127,0.9);
        height:100%;
        overflow:hidden;
        position:relative;
        z-index:10;
    }
    
    0 讨论(0)
提交回复
热议问题