{"id":9297,"date":"2022-10-06T04:39:10","date_gmt":"2022-10-06T04:39:10","guid":{"rendered":"https:\/\/mdr.foobrdigital.com\/?p=9297"},"modified":"2022-10-06T04:39:10","modified_gmt":"2022-10-06T04:39:10","slug":"svg-ellipse","status":"publish","type":"post","link":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/2022\/10\/06\/svg-ellipse\/","title":{"rendered":"SVG Ellipse"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"description-of-the-lt-ellipse-gt-element-1\">Description of the &lt;ellipse&gt; element<\/h2>\n\n\n\n<p>The SVG &lt;ellipse> element creates ellipses. The ellipse is centered by using the\u00a0cx\u00a0and\u00a0cy\u00a0attributes. However, unlike the\u00a0&lt;circle>\u00a0element, the radius in the x and y coordinates is specified by two attributes, not one.<\/p>\n\n\n\n<p>An ellipse and a circle are similar. The difference between them is that an ellipse has an x and y radii, which differ from each other. The x and y radius of a circle is equal. Ellipses can\u2019t define the exact orientation of the ellipse, but you can rotate it with the&nbsp;transform&nbsp;attribute.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"example-of-the-svg-lt-ellipse-gt-element-4\">Example of the SVG &lt;ellipse&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 width=\"400\" height=\"200\" &gt;\n      &lt;ellipse cx=\"230\" cy=\"120\" rx=\"150\" ry=\"70\" style=\"fill:pink;stroke:lightblue;stroke-width:5\" \/&gt;\n      Sorry, inline SVG isn't supported by your browser.  \n    &lt;\/svg&gt;\n  &lt;\/body&gt;\n&lt;\/html&gt;<\/code><\/pre>\n\n\n\n<p>Now let\u2019s explain the code above:<\/p>\n\n\n\n<ul><li>The&nbsp;cx&nbsp;attribute specifies the x coordinate of the center of the ellipse.<\/li><li>The&nbsp;cy&nbsp;attribute specifies the y coordinate of the center of the ellipse.<\/li><li>The&nbsp;rx&nbsp;attribute specifies the horizontal radius.<\/li><li>The&nbsp;ry&nbsp;attribute specifies the vertical radius.<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"example-of-the-svg-lt-ellipse-gt-element-for-creating-two-ellipses-on-top-of-each-other-7\">Example of the SVG &lt;ellipse&gt; element for creating two ellipses on top of each other:<\/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  width=\"400\" height=\"200\"&gt;\n      &lt;ellipse cx=\"200\" cy=\"110\" rx=\"160\" ry=\"25\" style=\"fill:lightblue\" \/&gt;\n      &lt;ellipse cx=\"190\" cy=\"85\" rx=\"140\" ry=\"20\" style=\"fill:blue\" \/&gt;\n      Sorry,inline SVG isn't supported by your browser. \n    &lt;\/svg&gt;\n  &lt;\/body&gt;\n&lt;\/html&gt;<\/code><\/pre>\n\n\n\n<p>You can add as many ellipses as you want with different colors and sizes.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"example-of-the-svg-lt-ellipse-gt-element-for-combining-two-ellipses-10\">Example of the SVG &lt;ellipse&gt; element for combining two ellipses:<\/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 width=\"400\" height=\"150\" &gt;\n      &lt;ellipse cx=\"200\" cy=\"70\" rx=\"200\" ry=\"35\" style=\"fill:purple\" \/&gt;\n      &lt;ellipse cx=\"190\" cy=\"70\" rx=\"160\" ry=\"25\" style=\"fill:lightgrey\" \/&gt;\n      Sorry, inline SVG isn't supported by your browser.\n    &lt;\/svg&gt;\n  &lt;\/body&gt;\n&lt;\/html&gt;<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Attribute<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td>cx<\/td><td>This attribute specifies the x position of the ellipse.<\/td><\/tr><tr><td>cy<\/td><td>This attribute specifies the y position of the ellipse.<\/td><\/tr><tr><td>rx<\/td><td>This attribute specifies the radius of the ellipse on the x-axis.<\/td><\/tr><tr><td>ry<\/td><td>This attribute specifies the radius of the ellipse on the y-axis.<\/td><\/tr><tr><td>pathlength<\/td><td>This attribute specifies the total length for the path, in user units.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>The SVG &lt;ellipse> element also supports the\u00a0Global Attributes\u00a0and\u00a0Event Attributes.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Description of the &lt;ellipse&gt; element The SVG &lt;ellipse> element creates ellipses. The ellipse is centered by using the\u00a0cx\u00a0and\u00a0cy\u00a0attributes. However, unlike the\u00a0&lt;circle>\u00a0element, the radius in the x and y coordinates is specified by two attributes, not one. An ellipse and a circle are similar. The difference between them is that an ellipse has an x and [&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\/9297"}],"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=9297"}],"version-history":[{"count":0,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/posts\/9297\/revisions"}],"wp:attachment":[{"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/media?parent=9297"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/categories?post=9297"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/tags?post=9297"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}