Import from <img> tag

Notes:
  • Browser can not autodetect height/width of an SVG file and sets unless <svg> tag specifies it explicitly.
Setting width in <svg>
Setting width in <img>
Autosize SVG <img>
This example tries trick explained in http://stackoverflow.com/a/14363879 but it fails, because <img> doesn't provide access to the structure of underlying <svg> data.
Conclusion: use <img> only if you know real <svg> size and don't need to change SVG content dynamically.

Import with <object> tag

Notes:
  • 300x150 bounding box indicates the same problem with autodetecting height/width of an SVG file.
  • In Firefox there is the bug that adds 1px space between <object> border and SVG.
  • Short <object/> tag doesn't work.
Setting width in <svg>
Setting width in <img>