E
E
Eugene2016-08-28 10:39:36
css
Eugene, 2016-08-28 10:39:36

How to make SVG responsive with mask?

Can you tell me how to implement this block?
5d923fcc49fa4df1a5f9b74fb77524a8.jpg
It is necessary that the image and the block stretch in width, and the height remains fixed.
So I tried to implement, but I can’t stretch it all

<svg xmlns="http://www.w3.org/2000/svg" width="1600px" height="820" viewBox="0 0 1600 820">
    <clipPath id="clipping">
      <path fill-rule="evenodd" clip-rule="evenodd" fill="#ccc" d="M0,761.932c0,0,366.372,58.068,900,58.068s900-58.068,900-58.068V0 H0V761.932z"/>
    </clipPath>
    <image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://hd.unsplash.com/photo-1470010762743-1fa2363f65ca" width="1800" height="820" class="item" />
  </svg>

.item {
  clip-path: url(#clipping);
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
A person from Kazakhstan, 2016-08-28
@LenovoId

in your case, this is not possible, most likely, since your viewBox is limited in size and your path is in pixel , for this you need to save the image in SVG and lay it out as background , which is easier to do on png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question