Clip div with SVG path

前端 未结 1 1896
自闭症患者
自闭症患者 2020-12-21 19:10

I have two overlapping divs and I am trying to achieve the following effect:

In order to do that my logic is to get the two divs to overlap, c

1条回答
  •  北荒
    北荒 (楼主)
    2020-12-21 19:50

    You can use the SVG command clipPath

    
                 
          
    

    
    
    
    

    DEMO

    UPD

    Additionally, on the proposal in the comments

    only te bottom image needs to be clipped and it will overlap the top one.

    .banner_1 {
      min-height: 100px;
      background-color: #41ffffdb;
     
    }
    .banner_2 {
      background:url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/4273/hawaii-beach.jpg);
       background-size:cover;
    }
    
    
    

    To replace the lower picture, change the background:url

    DEMO

    0 讨论(0)
提交回复
热议问题