Skip to Content

SVG Ellipses in HTML

Here's a quick tutorial that will teach you how to create an ellipse with HTML's svg and ellipse tags.

SVG ellipse

<svg xmlns=""
viewBox="0 0 1000 200">

<ellipse cx="500" cy="100"
rx="150" ry="75"
opacity="1.0" />
Ad - Web Hosting from SiteGround - Crafted for easy site management. Click to learn more.
Advertising Disclosure: I am compensated for purchases made through affiliate links. Click here for details.

The Attributes

Here are the attributes used to define our ellipses:

  • cx & cy: The x and y coordinates of the center of the ellipse.
  • rx & ry: The radius of the ellipse.
  • stroke: The color of the border line. This value can be defined either by specifying a hexadecimal color code as we did above or by using a valid color name.
  • stroke-width: The width of the border line output to the screen, relative to the size of the viewbox.
  • fill: The fill color can also be defined as a hexadecimal color code or color name and will fill the ellipse with the color specified. Specifying a value of none will keep the ellipse fill color transparent.
  • opacity: Determines if the ellipse will have any transparency. Valid decimal values can be between 0.0 (invisible) and 1.0 (fully visible). A value of 0.5 would give the ellipse 50% transparency.

Other SVG Paths & Shapes


Posted by: Josh Rowe
Created: April 08, 2022


There are no comments yet. Start the conversation!

Add A Comment

Comment Etiquette: Wrap code in a <code> and </code>. Please keep comments on-topic, do not post spam, keep the conversation constructive, and be nice to each other.