A
A
Andrey Frolov2016-02-27 00:06:42
Web development
Andrey Frolov, 2016-02-27 00:06:42

How to make svg fluid in width?

There is an svg image, I need that regardless of the given width (50px, 500px or any other value), the height always remains the same, and the width is stretched or compressed. Is it possible to do this. And if possible, how?
Here is the svg itself

<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" viewBox="0 0 100 120">
  <filter id='inset-shadow'>
    <feOffset dx='0' dy='10' />
    <feGaussianBlur stdDeviation='5' result='offset-blur' />
    <feComposite operator='out' in='SourceGraphic' in2='offset-blur' result='inverse' />
    <feFlood flood-color='black' flood-opacity='1' result='color' />
    <feComposite operator='in' in='color' in2='inverse' result='shadow' />
    <feComposite operator='over' in='shadow' in2='SourceGraphic' />
  </filter>

  <path fill="#eaebee" d="M0,101v19h100l0-19C83.4,67.3,66.7,33.7,50,0L0,101z"  filter="url(#inset-shadow)"/>
</svg>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
kravchenko-me, 2016-02-27
@farpram

codepen.io/anon/pen/qZBRYG
In the markup in svg we write preserveAspectRatio="none" this disables preservation of proportions

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question