CSS: -webkit-mask-image

后端 未结 3 2030
耶瑟儿~
耶瑟儿~ 2020-12-25 08:09

I\'m using the CSS property

-webkit-mask-image

To apply a mask over an image. However, in chrome, the mask moves as you scroll the image o

3条回答
  •  隐瞒了意图╮
    2020-12-25 09:08

    If I'm understanding your question correctly... You should be able to use SVG clip-path and then position your wrapper div however you like.

    Working Example

    body {
        height: 1800px;
    }
    #wrapper {
        position:absolute;
        top:100px;
        left:100px;
    }
    #map1 {
        width: 251px;
        height: 254px;
        -webkit-clip-path: url(#clipping);
        clip-path: url(#clipping);
    }
    svg {
        height:0;
    }
    
    

    Tested and working in Firefox and Chrome.

提交回复
热议问题