+ 1
How exactly does viewBox work when you haven't added width and height to your SVG?
I know how viewbox works, but when I use it without adding width and height to my SVG for some reason the viewport becomes huge, and I don't mind it, I can easily fix it by adding the width and height attributes, however, I'm curious to understand why it behaves this way, and why does somebody use the viewbox this way? Are there any advantages when you use it like this?
1 Réponse
+ 1
From what I understand it takes the biggest size that can fit in the page, depending on the valuea of the viewBox the shape is formed, for example, if height and width have same size we have a square, so it makes a square and makes it as big as possible.