Cutting a hole in a parent element with CSS

前端 未结 1 1889
深忆病人
深忆病人 2020-12-19 20:26

I don\'t know if this is possible, but I would like to cut holes in an opaque wrapper set to the height and width of the window to a layer of video beneath it u

1条回答
  •  醉酒成梦
    2020-12-19 20:48

    You could use a transparent png or svg to create the shape overlay, with the blank areas in effect becoming the mask or you could use the clip or mask property in CSS.

    Here's a jsFiddle example using svg.

    External JS/CSS:

    
    
    

    HTML:

    
    
    
    
        

    CSS:

    #wrapper {
        position: absolute;
        height: 100%;
        width: 100%;
        z-index: 5;
    }
    #videoDiv {
        position: absolute;
        z-index: -5;
    }
    

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