Set cx, cy, and r
Use cx and cy for the circle center, then r for radius. A circle with cx="60", cy="60", and r="42" is centered in a 120 by 120 viewBox.
svg circle
The SVG circle element draws a circle from a center point and radius. Use cx and cy to place the center, r to set the radius, then preview the circle inside the viewBox.
Use cx and cy for the circle center, then r for radius. A circle with cx="60", cy="60", and r="42" is centered in a 120 by 120 viewBox.
Use fill, stroke, stroke-width, opacity, and currentColor for visual states.
Make sure cx minus r and cy minus r stay above zero, and cx plus r and cy plus r stay inside the SVG coordinate system.
<svg viewBox="0 0 120 120"><circle cx="60" cy="60" r="42" fill="#0e7c66"/><circle cx="60" cy="60" r="18" fill="white"/></svg>
<circle cx="60" cy="60" r="42" fill="#0e7c66"/>
Use the circle element with cx, cy, and r attributes.
cx is the x coordinate of the center, cy is the y coordinate of the center, and r is the radius.
The circle may extend outside the SVG viewBox when its center and radius place part of the shape outside the coordinate system.