SVG clipPath to clip the *outer* content out

前端 未结 1 1049
悲哀的现实
悲哀的现实 2020-12-08 21:30

Normally, the element hides everything that is outshide the clip path. To achieve the opposite effect - that is to \"cut out\" something from t

1条回答
  •  爱一瞬间的悲伤
    2020-12-08 21:59

    It's much easier to do what you're after with a mask, see this example. Here's the mask definition:

    
      
      ABC
    
    

    Regions that are white inside the mask will be kept, everything else will be clipped away.

    Here's another example that uses clipPath instead, is a bit trickier since you need to use a path element to get the clip-rule to apply. The clipPath that uses clip-rule there looks like this:

    
      
    
    

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