Friday, March 13, 2015

Eclipse in SVG

An ellipse can is very similar to circle but it not completely same because the radius in circle is same but in ellipse the radius x and the radius y is different in length. The  <ellipse> element is used for the creation of ellipse.

Example:
 <!DOCTYPE html>  
 <html>  
 <head lang="en">  
   <meta charset="UTF-8">  
   <title>SVGTutorials</title>  
 </head>  
 <body>  
 <h2>An Example of Ellipse</h2>  
 <svg height="160" width="500">  
   <ellipse cx="300" cy="90" rx="110" ry="60" style="fill:#caff9e;stroke:#d2d2d2;stroke-width:5" />  
   Your browser does not support inline SVG.  
 </svg>  
 <svg height="150" width="500">  
   <ellipse cx="220" cy="100" rx="220" ry="26" style="fill:#009600" />  
   <ellipse cx="210" cy="70" rx="190" ry="18" style="fill:#70a5ff" />  
   <ellipse cx="220" cy="45" rx="170" ry="12" style="fill:#ff9046" />  
 </svg>  
 </body>  
 </html>

No comments:

Post a Comment