Using HTML and CSS, how do you change the size of an SVG (using an <img />
tag to get svg file) WITHOUT keeping the aspect ratio?
Just add preserveAspectRatio="none"
to the <svg>
root element. Or if you want you can override it when linking to the img, like in this example, by using a link like this:
<img src="your.svg#svgView(preserveAspectRatio(none))" />
For a live example, try this and resize the browser window.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With