{"id":4004,"date":"2015-08-16T11:17:46","date_gmt":"2015-08-16T15:17:46","guid":{"rendered":"http:\/\/webninjataylor.com\/library\/?p=4004"},"modified":"2015-08-16T11:28:17","modified_gmt":"2015-08-16T15:28:17","slug":"sizing-inline-svg","status":"publish","type":"post","link":"https:\/\/webninjataylor.com\/library\/sizing-inline-svg\/","title":{"rendered":"Sizing Inline SVG"},"content":{"rendered":"<p>The best way I found to size inline SVG graphics:<\/p>\n<ul>\n<li>Trim artboard to artwork bounds in Illustrator (Object &gt; Artboards &gt; Fit to Artwork Bounds)<\/li>\n<li>Save as SVG and then open it in\u00a0a text editor<\/li>\n<li>Leave the viewBox dimensions exactly as they are<\/li>\n<li>Calculate the % difference between width and height in the viewBox values<\/li>\n<li>Set the width and height of the viewport (SVG tag) to desired size as well as preserveAspectRatio to &#8220;xMidYMid meet&#8221; for expanding to fit centered while maintaining aspect ratio<\/li>\n<\/ul>\n<p>Example&#8230;<\/p>\n<pre>&lt;svg width=\"83px\" height=\"100px\" viewBox=\"0 0 28.322 33.986\" preserveAspectRatio=\"xMidYMid meet\"&gt;<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>The best way I found to size inline SVG graphics: Trim artboard to artwork bounds in Illustrator (Object &gt; Artboards &gt; Fit to Artwork Bounds) Save as SVG and then open it in\u00a0a text editor Leave the viewBox dimensions exactly as they are Calculate the % difference between width and height in the viewBox values [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[144],"tags":[19,40],"class_list":["post-4004","post","type-post","status-publish","format-standard","hentry","category-web-shots","tag-css","tag-html"],"_links":{"self":[{"href":"https:\/\/webninjataylor.com\/library\/wp-json\/wp\/v2\/posts\/4004","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webninjataylor.com\/library\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webninjataylor.com\/library\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webninjataylor.com\/library\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/webninjataylor.com\/library\/wp-json\/wp\/v2\/comments?post=4004"}],"version-history":[{"count":4,"href":"https:\/\/webninjataylor.com\/library\/wp-json\/wp\/v2\/posts\/4004\/revisions"}],"predecessor-version":[{"id":4008,"href":"https:\/\/webninjataylor.com\/library\/wp-json\/wp\/v2\/posts\/4004\/revisions\/4008"}],"wp:attachment":[{"href":"https:\/\/webninjataylor.com\/library\/wp-json\/wp\/v2\/media?parent=4004"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webninjataylor.com\/library\/wp-json\/wp\/v2\/categories?post=4004"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webninjataylor.com\/library\/wp-json\/wp\/v2\/tags?post=4004"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}