Contents
Just set the viewBox on your
How do I scale an SVG image?
How to resize a SVG image
- Change width and height in XML format. Open the SVG file with your text editor. It should show lines of code as below. <svg width=”54px” height=”54px” viewBox=”0 0 54 54″ version=”1.1″ xmlns_xlink=” …
- 2 . Use “background-size” Another solution is to use CSS.
How do I fix SVG size?
2 Answers
- Give your SVG element a fixed height. If you do not do this the height of the element will change proportional to the width.
- Adjust your viewBox to crop to the height of your content.
- Fix your preserveAspectRatio value to have the proper case-sensitive value, e.g. xMinYMin (not xMinYmin ).
5.02.2015