{"id":15254,"date":"2012-10-22T21:01:27","date_gmt":"2012-10-22T13:01:27","guid":{"rendered":"https:\/\/www.hongkiat.com\/blog\/?p=15254"},"modified":"2025-04-04T01:13:09","modified_gmt":"2025-04-03T17:13:09","slug":"scalable-vector-graphic","status":"publish","type":"post","link":"https:\/\/www.hongkiat.com\/blog\/scalable-vector-graphic\/","title":{"rendered":"A Look into: Scalable Vector Graphics (SVG)"},"content":{"rendered":"<p><a href=\"https:\/\/www.hongkiat.com\/blog\/download-free-vector-websites\/\">Vector graphics<\/a> have been widely applied in <a href=\"https:\/\/www.hongkiat.com\/blog\/print-design-vs-web-design\/\">print media<\/a>. In a website, we can also add vector graphics with SVG or <strong>Scalable Vector Graphic<\/strong>. Citing from the <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.w3.org\/TR\/SVG\/\">official spec at W3.org<\/a>, SVG is described as:<\/p>\n<p><em>A language for describing two-dimensional graphics in XML. SVG allows for three types of \u00dfgraphic objects: vector graphic shapes (e.g., paths consisting of straight lines and curves), images and text.<\/em><\/p>\n<p><a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/en.wikipedia.org\/wiki\/Scalable_Vector_Graphics\">It has actually been around since 1999<\/a> and <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.w3.org\/TR\/SVG11\/\">as of 16 August 2011, it became a W3C Recommendation<\/a>. Yet, SVG is still considerably underused, whereas there are a lot of advantages in using Vector rather than Bitmap to serve graphic or image on a website.<\/p>\n<h2>SVG Advantages<\/h2>\n<p>In term of serving graphics on websites, SVG offers a few advantages over Bitmap, some of which include:<\/p>\n<h3>Resolution Independent<\/h3>\n<p>Bitmap\/raster graphic is <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/en.wikipedia.org\/wiki\/Raster_graphics\">resolution dependent<\/a> \u2013 it is built upon pixels. Graphics served will looked pixelated when it is resized at a certain zoom level. That doesn\u2019t happen to vector graphic, which is <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/en.wikipedia.org\/wiki\/Resolution_independence\">resolution independent<\/a> in nature, as the graphic is expressed with a mathematical equation which makes it <strong>scalable at any zoom level while maintaining quality<\/strong>, even at <a href=\"https:\/\/www.hongkiat.com\/blog\/mbp-retina-blurry-text\/\">Retina Display<\/a>.<\/p>\n<h3>Reducing HTTP Request<\/h3>\n<p>SVG can be embedded directly into an HTML document with <code>svg<\/code> tag, so the browser does not need to do a request to serve the graphic. This also results in better load performance for the website.<\/p>\n<h3>Styling and Scripting<\/h3>\n<p>Embedding directly with <code>svg<\/code> tag will also allow us to style the graphic easily through <a href=\"https:\/\/www.hongkiat.com\/blog\/tag\/css\/\">CSS<\/a>. We can <strong>change object properties<\/strong> such as background color, opacity, borders, etc the same way we do with regular HTML tag. Similarly, we can also manipulate the graphic via JavaScript.<\/p>\n<h3>Can be animated and Edited<\/h3>\n<p>SVG object can be animated when it uses the animation element or through JavaScript Library like jQuery. The SVG object can also be edited with any text code editor or a graphic software like <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/inkscape.org\/\">Inkscape<\/a> (<a href=\"https:\/\/www.hongkiat.com\/blog\/free-windows-software-for-web-designers-on-budget\/\">which is free<\/a>) or <a rel=\"nofollow noopener\" target=\"_blank\" href=\"http:\/\/www.adobe.com\/products\/illustrator.html\">Adobe Illustrator<\/a>.<\/p>\n<h3>Smaller File Size<\/h3>\n<p>SVG has a <a href=\"https:\/\/www.hongkiat.com\/blog\/jpeg-optimization-guide\/\">smaller file size<\/a> compared to Bitmap, that has a similar graphic presentation.<\/p>\n<h2>Drawing Basic Shapes with SVG<\/h2>\n<p>According to the spec, we can draw <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.w3.org\/TR\/SVG11\/shapes.html\">some basic shapes<\/a> like the <strong>rectangle, circle, line, ellipse, polyline and polygon<\/strong> with SVG and in order for the browser to render the SVG graphic, all those graphic elements need to be inserted within the <code>&lt;svg&gt; ... &lt;\/svg&gt;<\/code> tag. Let\u2019s see the examples below for more details:<\/p>\n<h3>Line<\/h3>\n<p>To draw <strong>a line<\/strong> in SVG we can use the <code>&lt;line&gt;<\/code> element. This element is used to draw a single straight line, so it will only consist of two points, <strong>start<\/strong> and <strong>end<\/strong>.<\/p>\n<pre>\r\n &lt;svg&gt;\r\n &lt;line x1=\"0\" y1=\"0\" x2=\"200\" y2=\"200\" stroke-width=\"1\" stroke=\"rgb(0,0,0)\"\/&gt;\r\n &lt;\/svg&gt;\r\n <\/pre>\n<p>As you can see above, the line start point coordinate is expressed with the first two attributes <code>x1<\/code> and <code>x2<\/code>, while the line\u2019s end point coordinate is expressed with <code>y1<\/code> and <code>y2<\/code>.<\/p>\n<p>There are also two other attributes, the <code>stroke<\/code> and <code>stroke-width<\/code> which are used to define the border\u2019s color and border\u2019s width, respectively. Alternatively, we can also define these attributes within an inline style, like so:<\/p>\n<pre>\r\n style=\"stroke-width:1; stroke:rgb(0,0,0);\"\r\n <\/pre>\n<p>it eventually just does the same.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/scalable-vector-graphic\/svg-line.jpg\" width=\"500\" height=\"280\"><\/figure>\n<ul class=\"download download-1c\">\n<li><a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/hongkiat.github.io\/scalable-vector-graphic\/\">View Demo \u201cLine\u201d<\/a> <\/li>\n<\/ul>\n<h3>Polyline<\/h3>\n<p>It\u2019s almost similar to the <code>&lt;line&gt;<\/code>, but with the <code>&lt;polyline&gt;<\/code> element we can draw multiple lines instead of just one. Here is an example:<\/p>\n<pre>\r\n &lt;svg&gt;\r\n &lt;polyline points=\"0,0 50,0 150,100 250,100 300,150\" fill=\"rgb(249,249,249)\" stroke-width=\"1\" stroke=\"rgb(0,0,0)\"\/&gt;\r\n &lt;\/svg&gt;\r\n <\/pre>\n<p><code>&lt;polyline&gt;<\/code> element has <code>points<\/code> attributes that store all the coordinates that form the lines.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/scalable-vector-graphic\/svg-polyline.jpg\" width=\"500\" height=\"280\"><\/figure>\n<ul class=\"download download-1c\">\n<li><a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/hongkiat.github.io\/scalable-vector-graphic\/\">View Demo \u201cPolyline\u201d<\/a> <\/li>\n<\/ul>\n<h3>Rectangle<\/h3>\n<p>Drawing a rectangle is also simple with this <code>&lt;rect&gt;<\/code> element. We only need to specify the width and height, like so:<\/p>\n<pre>\r\n &lt;svg&gt;\r\n &lt;rect width=\"200\" height=\"200\" fill=\"rgb(234,234,234)\" stroke-width=\"1\" stroke=\"rgb(0,0,0)\"\/&gt;\r\n &lt;\/svg&gt;\r\n <\/pre>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/scalable-vector-graphic\/svg-rect.jpg\" width=\"500\" height=\"280\"><\/figure>\n<ul class=\"download download-1c\">\n<li><a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/hongkiat.github.io\/scalable-vector-graphic\/\">View Demo \u201cRectangle\u201d<\/a> <\/li>\n<\/ul>\n<h2>Circle<\/h2>\n<p>We can also draw a circle with the <code>&lt;circle&gt;<\/code> element. In the following example, we will create a circle with <code>100<\/code> radius which is defined with <code>r<\/code> attribute:<\/p>\n<pre>\r\n &lt;svg&gt;\r\n &lt;circle cx=\"102\" cy=\"102\" r=\"100\" fill=\"rgb(234,234,234)\" stroke-width=\"1\" stroke=\"rgb(0,0,0)\"\/&gt;\r\n &lt;\/svg&gt;\r\n <\/pre>\n<p>The first two attributes, <code>cx<\/code> and <code>cy<\/code> are defining the circle\u2019s center coordinate. In the above example, we have set <code>102<\/code> both for the <code>x<\/code> and <code>y<\/code> coordinate, if these attributes are not specified, <code>0<\/code> will be taken as the default value.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/scalable-vector-graphic\/svg-circle.jpg\" width=\"500\" height=\"280\"><\/figure>\n<ul class=\"download download-1c\">\n<li><a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/hongkiat.github.io\/scalable-vector-graphic\/\">View Demo \u201cCircle\u201d<\/a> <\/li>\n<\/ul>\n<h2>Ellipse<\/h2>\n<p>We can draw an ellipse with <code>&lt;ellipse&gt;<\/code>. It works quite similar to the circle, but this time we can control specifically the <code>x<\/code> line radius and <code>y<\/code> line radius with <code>rx<\/code> and <code>ry<\/code> attribute;<\/p>\n<pre>\r\n &lt;svg&gt;\r\n &lt;ellipse cx=\"100\" cy=\"50\" rx=\"100\" ry=\"50\" fill=\"rgb(234,234,234)\" stroke-width=\"1\" stroke=\"rgb(0,0,0)\"\/&gt;\r\n &lt;\/svg&gt;\r\n <\/pre>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/scalable-vector-graphic\/svg-ellipse.jpg\" width=\"500\" height=\"280\"><\/figure>\n<ul class=\"download download-1c\">\n<li><a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/hongkiat.github.io\/scalable-vector-graphic\/\">View Demo \u201cEllipse\u201d<\/a> <\/li>\n<\/ul>\n<h2>Polygon<\/h2>\n<p>With the <code>&lt;polygon&gt;<\/code> element, we can draw multiple sides of shapes like a triangle, hexagon and even a rectangle. Here is an example:<\/p>\n<pre>\r\n &lt;svg&gt;\r\n &lt;polygon points=\"70.444,218.89 15.444,118.89 70.444,18.89 180.444,18.89 235.444,118.89 180.444,218.89\" fill=\"rgb(234,234,234)\" stroke-width=\"1\" stroke=\"rgb(0,0,0)\"\/&gt;\r\n &lt;\/svg&gt;\r\n <\/pre>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/scalable-vector-graphic\/svg-polygon.jpg\" width=\"500\" height=\"280\"><\/figure>\n<ul class=\"download download-1c\">\n<li><a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/hongkiat.github.io\/scalable-vector-graphic\/\">View Demo \u201cPolygon\u201d<\/a> <\/li>\n<\/ul>\n<h2>Using Vector Graphic Editor<\/h2>\n<p>As you can see, drawing simple objects with SVG in <a href=\"https:\/\/www.hongkiat.com\/blog\/tag\/html\/\">HTML<\/a> is quite easy. However, when the object gets more complex, that practice is no longer ideal and will give you a headache.<\/p>\n<p>Fortunately, as we\u2019ve mentioned above, we can use a vector graphic editor like <strong>Adobe Illustrator<\/strong> or <strong>Inkscape<\/strong> to do the job. If you are familiar with these software, it is surely a lot easier to draw objects with their GUI rather than to code the graphic yourself in HTML tag.<\/p>\n<p><strong>If you are working with Inkscape<\/strong>, you can save your vector graphic as plain SVG, and then open it in text code editor. Now, you should find the SVG codes in the file. Copy all the codes and paste them inside your HTML document.<\/p>\n<p>Or, you can also embed the <code>.svg<\/code> file through one of these elements; <code>embed<\/code>, <code>iframe<\/code> and <code>object<\/code>, for instance;<\/p>\n<pre>\r\n &lt;object data=\"images\/ipod.svg\" type=\"image\/svg+xml\"&gt;&lt;\/object&gt;\r\n <\/pre>\n<p>The results will eventually be the same.<\/p>\n<p>In this example, I use this <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/openclipart.org\/detail\/147673\/apple-ipod-by-nikla88\">Apple iPod<\/a> from <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/openclipart.org\/\">OpenClipArt.org<\/a>.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/scalable-vector-graphic\/svg-ipod.jpg\" width=\"500\" height=\"300\"><\/figure>\n<ul class=\"download download-1c\">\n<li><a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/hongkiat.github.io\/scalable-vector-graphic\/\">View Demo \u201ciPod\u201d<\/a> <\/li>\n<\/ul>\n<h2>Browser Support<\/h2>\n<p>Regarding browser support, <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/caniuse.com\/svg\">SVG has been very well supported in all major browsers<\/a>, except in IE8 and earlier. But this matter can be solved with this JavaScript Library, called Raphael.js. In order to make things easier we will use this tool, <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/readysetraphael.com\/\">ReadySetRaphael.com<\/a> to convert our SVG code into Raphael-supported format. Here\u2019s how.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/scalable-vector-graphic\/svg-raphael.jpg\" width=\"500\" height=\"280\"><\/figure>\n<p>First of all, download and include the <strong>Raphael.js<\/strong> library to your HTML document. Then, upload the <code>.svg<\/code> file to the site, copy and paste the generated code inside the following load <code>function<\/code>;<\/p>\n<pre>\r\n window.onload=function() { \r\n \/\/the Raphael code goes here\r\n }\r\n <\/pre>\n<p>Inside the <code>body<\/code> tag, put the following <code>div<\/code> with <code>rsr<\/code> id attribute;<\/p>\n<pre>\r\n &lt;div id=\"rsr\"&gt;&lt;\/div&gt;\r\n <\/pre>\n<p>That\u2019s it, you\u2019re done. Check out the example from the link below.<\/p>\n<ul class=\"download download-1c\">\n<li><a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/hongkiat.github.io\/scalable-vector-graphic\/\">View Demo \u201cRaphael\u201d<\/a> <\/li>\n<\/ul>\n<h2>Final Thoughts<\/h2>\n<p>So that\u2019s the basics with SVG. We hope now you have a fair understanding of this subject. It is the best way to optimize your site for any screen resolution, even for use on Retina display.<\/p>\n<p>As always, if you are an adventurous person, here we have put a few more references and discussion to dig deeper into this subject.<\/p>\n<ul>\n<li><a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.w3schools.com\/graphics\/svg_intro.asp\">An Introduction to SVG<\/a> \u2013 W3 Schools <\/li>\n<li><a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/code.tutsplus.com\/tutorials\/why-arent-you-using-svg\/\">Why Aren\u2019t You Using SVG?<\/a> \u2013 NetTuts <\/li>\n<\/ul>\n<p>Thanks for reading and we hope you enjoyed this post.<\/p>\n<ul class=\"download download-2c\">\n<li><a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/hongkiat.github.io\/scalable-vector-graphic\/\">View Demo<\/a> <\/li>\n<li><a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/github.com\/hongkiat\/scalable-vector-graphic\/\">Download Source<\/a> <\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>Vector graphics have been widely applied in print media. In a website, we can also add vector graphics with SVG or Scalable Vector Graphic. Citing from the official spec at W3.org, SVG is described as: A language for describing two-dimensional graphics in XML. SVG allows for three types of \u00dfgraphic objects: vector graphic shapes (e.g.,&hellip;<\/p>\n","protected":false},"author":113,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3392,352],"tags":[2175],"topic":[4520],"class_list":["entry-content","is-maxi"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v22.8 (Yoast SEO v27.5) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Scalable Vector Graphics (SVG) - Beginner&#039;s Guide<\/title>\n<meta name=\"description\" content=\"Vector graphics have been widely applied in print media. In a website, we can also add vector graphics with SVG or Scalable Vector Graphic. Citing from\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.hongkiat.com\/blog\/scalable-vector-graphic\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"A Look into: Scalable Vector Graphics (SVG)\" \/>\n<meta property=\"og:description\" content=\"Vector graphics have been widely applied in print media. In a website, we can also add vector graphics with SVG or Scalable Vector Graphic. Citing from\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.hongkiat.com\/blog\/scalable-vector-graphic\/\" \/>\n<meta property=\"og:site_name\" content=\"Hongkiat\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/hongkiatcom\" \/>\n<meta property=\"article:published_time\" content=\"2012-10-22T13:01:27+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-03T17:13:09+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/assets.hongkiat.com\/uploads\/scalable-vector-graphic\/svg-line.jpg\" \/>\n<meta name=\"author\" content=\"Thoriq Firdaus\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@tfirdaus\" \/>\n<meta name=\"twitter:site\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Thoriq Firdaus\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/scalable-vector-graphic\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/scalable-vector-graphic\\\/\"},\"author\":{\"name\":\"Thoriq Firdaus\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/e7948c7a175d211496331e4b6ce55807\"},\"headline\":\"A Look into: Scalable Vector Graphics (SVG)\",\"datePublished\":\"2012-10-22T13:01:27+00:00\",\"dateModified\":\"2025-04-03T17:13:09+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/scalable-vector-graphic\\\/\"},\"wordCount\":1064,\"commentCount\":46,\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/scalable-vector-graphic\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/scalable-vector-graphic\\\/svg-line.jpg\",\"keywords\":[\"Scalable Vector Graphics (SVG)\"],\"articleSection\":[\"Coding\",\"Web Design\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/scalable-vector-graphic\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/scalable-vector-graphic\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/scalable-vector-graphic\\\/\",\"name\":\"Scalable Vector Graphics (SVG) - Beginner's Guide\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/scalable-vector-graphic\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/scalable-vector-graphic\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/scalable-vector-graphic\\\/svg-line.jpg\",\"datePublished\":\"2012-10-22T13:01:27+00:00\",\"dateModified\":\"2025-04-03T17:13:09+00:00\",\"description\":\"Vector graphics have been widely applied in print media. In a website, we can also add vector graphics with SVG or Scalable Vector Graphic. Citing from\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/scalable-vector-graphic\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/scalable-vector-graphic\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/scalable-vector-graphic\\\/#primaryimage\",\"url\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/scalable-vector-graphic\\\/svg-line.jpg\",\"contentUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/scalable-vector-graphic\\\/svg-line.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/scalable-vector-graphic\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"A Look into: Scalable Vector Graphics (SVG)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"name\":\"Hongkiat\",\"description\":\"Tech and Design Tips\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\",\"name\":\"Hongkiat.com\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"contentUrl\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"width\":1200,\"height\":799,\"caption\":\"Hongkiat.com\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/hongkiatcom\",\"https:\\\/\\\/x.com\\\/hongkiat\",\"https:\\\/\\\/www.pinterest.com\\\/hongkiat\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/e7948c7a175d211496331e4b6ce55807\",\"name\":\"Thoriq Firdaus\",\"description\":\"Thoriq is a writer for Hongkiat.com with a passion for web design and development. He is the author of Responsive Web Design by Examples, where he covered his best approaches in developing responsive websites quickly with a framework.\",\"sameAs\":[\"https:\\\/\\\/thoriq.com\",\"https:\\\/\\\/x.com\\\/tfirdaus\"],\"jobTitle\":\"Web Developer\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/author\\\/thoriq\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Scalable Vector Graphics (SVG) - Beginner's Guide","description":"Vector graphics have been widely applied in print media. In a website, we can also add vector graphics with SVG or Scalable Vector Graphic. Citing from","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.hongkiat.com\/blog\/scalable-vector-graphic\/","og_locale":"en_US","og_type":"article","og_title":"A Look into: Scalable Vector Graphics (SVG)","og_description":"Vector graphics have been widely applied in print media. In a website, we can also add vector graphics with SVG or Scalable Vector Graphic. Citing from","og_url":"https:\/\/www.hongkiat.com\/blog\/scalable-vector-graphic\/","og_site_name":"Hongkiat","article_publisher":"https:\/\/www.facebook.com\/hongkiatcom","article_published_time":"2012-10-22T13:01:27+00:00","article_modified_time":"2025-04-03T17:13:09+00:00","og_image":[{"url":"https:\/\/assets.hongkiat.com\/uploads\/scalable-vector-graphic\/svg-line.jpg","type":"","width":"","height":""}],"author":"Thoriq Firdaus","twitter_card":"summary_large_image","twitter_creator":"@tfirdaus","twitter_site":"@hongkiat","twitter_misc":{"Written by":"Thoriq Firdaus","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.hongkiat.com\/blog\/scalable-vector-graphic\/#article","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/scalable-vector-graphic\/"},"author":{"name":"Thoriq Firdaus","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/e7948c7a175d211496331e4b6ce55807"},"headline":"A Look into: Scalable Vector Graphics (SVG)","datePublished":"2012-10-22T13:01:27+00:00","dateModified":"2025-04-03T17:13:09+00:00","mainEntityOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/scalable-vector-graphic\/"},"wordCount":1064,"commentCount":46,"publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/scalable-vector-graphic\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/scalable-vector-graphic\/svg-line.jpg","keywords":["Scalable Vector Graphics (SVG)"],"articleSection":["Coding","Web Design"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.hongkiat.com\/blog\/scalable-vector-graphic\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.hongkiat.com\/blog\/scalable-vector-graphic\/","url":"https:\/\/www.hongkiat.com\/blog\/scalable-vector-graphic\/","name":"Scalable Vector Graphics (SVG) - Beginner's Guide","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/scalable-vector-graphic\/#primaryimage"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/scalable-vector-graphic\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/scalable-vector-graphic\/svg-line.jpg","datePublished":"2012-10-22T13:01:27+00:00","dateModified":"2025-04-03T17:13:09+00:00","description":"Vector graphics have been widely applied in print media. In a website, we can also add vector graphics with SVG or Scalable Vector Graphic. Citing from","breadcrumb":{"@id":"https:\/\/www.hongkiat.com\/blog\/scalable-vector-graphic\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.hongkiat.com\/blog\/scalable-vector-graphic\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/scalable-vector-graphic\/#primaryimage","url":"https:\/\/assets.hongkiat.com\/uploads\/scalable-vector-graphic\/svg-line.jpg","contentUrl":"https:\/\/assets.hongkiat.com\/uploads\/scalable-vector-graphic\/svg-line.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.hongkiat.com\/blog\/scalable-vector-graphic\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.hongkiat.com\/blog\/"},{"@type":"ListItem","position":2,"name":"A Look into: Scalable Vector Graphics (SVG)"}]},{"@type":"WebSite","@id":"https:\/\/www.hongkiat.com\/blog\/#website","url":"https:\/\/www.hongkiat.com\/blog\/","name":"Hongkiat","description":"Tech and Design Tips","publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.hongkiat.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.hongkiat.com\/blog\/#organization","name":"Hongkiat.com","url":"https:\/\/www.hongkiat.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","contentUrl":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","width":1200,"height":799,"caption":"Hongkiat.com"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/hongkiatcom","https:\/\/x.com\/hongkiat","https:\/\/www.pinterest.com\/hongkiat\/"]},{"@type":"Person","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/e7948c7a175d211496331e4b6ce55807","name":"Thoriq Firdaus","description":"Thoriq is a writer for Hongkiat.com with a passion for web design and development. He is the author of Responsive Web Design by Examples, where he covered his best approaches in developing responsive websites quickly with a framework.","sameAs":["https:\/\/thoriq.com","https:\/\/x.com\/tfirdaus"],"jobTitle":"Web Developer","url":"https:\/\/www.hongkiat.com\/blog\/author\/thoriq\/"}]}},"jetpack_featured_media_url":"https:\/\/","jetpack_shortlink":"https:\/\/wp.me\/p4uxU-3Y2","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/15254","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/users\/113"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/comments?post=15254"}],"version-history":[{"count":5,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/15254\/revisions"}],"predecessor-version":[{"id":73548,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/15254\/revisions\/73548"}],"wp:attachment":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/media?parent=15254"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/categories?post=15254"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/tags?post=15254"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/topic?post=15254"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}