{"id":9299,"date":"2022-10-06T04:39:45","date_gmt":"2022-10-06T04:39:45","guid":{"rendered":"https:\/\/mdr.foobrdigital.com\/?p=9299"},"modified":"2022-10-06T04:39:45","modified_gmt":"2022-10-06T04:39:45","slug":"svg-line","status":"publish","type":"post","link":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/2022\/10\/06\/svg-line\/","title":{"rendered":"SVG Line"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"description-of-the-lt-line-gt-element-1\">Description of the &lt;line&gt; element<\/h2>\n\n\n\n<p>The SVG &lt;line&gt; element creates lines. Since the &lt;line&gt; elements are geometrically one-dimensional single lines, they do not have any interior. Therefore, they are never filled.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"example-of-the-svg-lt-line-gt-element-3\">Example of the SVG &lt;line&gt; element:<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n  &lt;head&gt;\n    &lt;title&gt;Title of the document&lt;\/title&gt;\n  &lt;\/head&gt;\n  &lt;body&gt;\n    &lt;svg height=\"310\" width=\"400\"&gt;\n      &lt;line x1=\"50\" y1=\"30\" x2=\"300\" y2=\"300\" style=\"stroke:rgb(8, 112, 177);stroke-width:3\" \/&gt;\n    &lt;\/svg&gt;\n  &lt;\/body&gt;\n&lt;\/html&gt;<\/code><\/pre>\n\n\n\n<p>Let\u2019s explain the code above:<\/p>\n\n\n\n<ul><li>The&nbsp;x1&nbsp;attribute specifies the beginning of the line on the x-axis.<\/li><li>The&nbsp;y1&nbsp;attribute specifies the beginning of the line on the y-axis.<\/li><li>The&nbsp;x2&nbsp;attribute specifies the end of the line on the x-axis.<\/li><li>The&nbsp;y2&nbsp;attribute specifies the end of the line on the y-axis.<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"svg-line-vs-svg-path-6\">SVG Line vs SVG Path<\/h2>\n\n\n\n<p>The SVG &lt;line&gt; and &lt;path&gt; elements are similar. However, they have some differences. Particularly, the &lt;line&gt; element draws a single straight line, and the &lt;path&gt; element draws the path of a shape or a line. Moreover, with it, you can draw any shape or line. So it\u2019s more suitable to use the SVG &lt;path&gt; element.<\/p>\n\n\n\n<p>The SVG &lt;line> element also supports the\u00a0Global Attributes\u00a0and\u00a0Event Attributes.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Description of the &lt;line&gt; element The SVG &lt;line&gt; element creates lines. Since the &lt;line&gt; elements are geometrically one-dimensional single lines, they do not have any interior. Therefore, they are never filled. Example of the SVG &lt;line&gt; element: Let\u2019s explain the code above: The&nbsp;x1&nbsp;attribute specifies the beginning of the line on the x-axis. The&nbsp;y1&nbsp;attribute specifies the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[574],"tags":[],"_links":{"self":[{"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/posts\/9299"}],"collection":[{"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/comments?post=9299"}],"version-history":[{"count":0,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/posts\/9299\/revisions"}],"wp:attachment":[{"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/media?parent=9299"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/categories?post=9299"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/tags?post=9299"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}