Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

SVG Circle

SVG Circle

In SVG, the element is used to draw circles; it is one of the commonly used basic shapes in SVG.

Use The element can create circular shapes, and the circle's position, size, and style can be controlled by setting attributes.

Basic Syntax



  cy="y-coordinate"      

  r="radius"             

  fill="fill-color"      

  stroke="stroke-color"  

  stroke-width="width"   

/>

Attribute Analysis:

The following code draws a circle with blue fill, black stroke, and a radius of 50 pixels, with center coordinates at (100, 100).



  



Example

Below is the SVG code:

Example

 

  stroke-width="2" fill="red"/>

Try it »

Click to view:View SVG File.

Code analysis: