SVG <circle>

SVG 圓 - <circle>

<circle> 元素用于創建圓:

這是 SVG 代碼:

實例

<svg height="100" width="100">
  <circle cx="50" cy="50" r="40" stroke="black" stroke-width="3" fill="red" />
</svg>

親自試一試

代碼解釋:

  • cx 和 cy 屬性定義圓心的 x 和 y 坐標。如果省略 cx 和 cy,則圓心設置為 (0,0)
  • r 屬性定義圓的半徑