Z
Z
zlodiak2018-09-04 17:00:02
JavaScript
zlodiak, 2018-09-04 17:00:02

How to compress svg only in width?

Please tell me how to make the svg stretch only in width, and the height always remains constant. Here's my attempt: JSFIDDLE
Here I couldn't think of anything better than setting the width='100%' attribute and the height='200px' attribute. At the same time, I set the viewport like this: But it did not help. Perhaps this problem has no solution at all, because I would like the proportions of the X-axis coordinates not to break when squeezing
viewBox='0 0 360 200'

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
GreatRash, 2018-09-04
@GreatRash

You should read about the preserveAspectRatio attribute.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question