Mask or Clip path for div with svg
https://codepen.io/melasculla/pen/vEOEYZX?editors=1100
hello there, i have an svg figure which is 1 one and i used it with mask and it worked fine but if i have smaller shape height bottom are cutted out so i've decided to use 2 svg path's for top and bottom and im having hard time to figure it out
i need to have middle part visible so top and bottom should look wavy
idk what else to try i've tried mask/clip-path
also i've tried
clipPath
and mask
tags in svg itself
please help me solve this, thanks in advance8 Replies
anyone?
The problem with clip path here is the top/bottom won't work. You'll see the black areas, and hide everything else.
The first one that's the entire shape is the best bet here.
The other problem is, if you want to use
objectBoundingBox
, the units you currentl have won't work. Using that, all the units need to be between 0 and 1, because a unit of 1 = 100%...
Will the element(s) your clipping ever have gradient or image backgrounds, or will they always be solid?thanks for an answer
i did actually solve this
i took 1 solid svg
https://yoksel.github.io/relative-clip-path/
converted it here
and applied like this
answering to your question, i have bg pattern in before element applied with mask

looks like that
btw
it actually works with my other pattern

but mask always take a place in the top
no matter what what i specified
as you can see it says
url('#mask-top')_bottom
but mask in the top
any thoughts why this happening?hmm, not 100%, I'd have to play with a working example