K
K
khipster2016-03-19 09:16:53
User interface
khipster, 2016-03-19 09:16:53

How to change the viewbox of an SVG image?

Here I downloaded a free SVG image, but it is very large. Well, I changed the width and height attributes as I needed, but some huge numbers remained in the viewBox attribute: "0 0 317.855 317.855".
viewBox is the viewport (clear, i.e. not clear). How to change it? And does it need to be changed at all? And why does the picture disappear when you try to change it to the width and height values? Has the author chosen it and is it now attached to the picture?
https://jsfiddle.net/nonzaot5/

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Beloshitsky, 2016-03-19
@khipster

The viewbox allows you to manipulate the image inside the svg image.
Here is an example of such manipulations with your picture.
Article for clarification: https://sarasoueidan.com/blog/svg-coordinate-systems/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question