SVG <circle>


SVG 圓形 - <circle>

<circle> 標籤可用來創建一個圓:

下麵是SVG代碼:

實例

<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<circle cx="100" cy="50" r="40" stroke="black"
stroke-width="2" fill="red"/>
</svg>

對於Opera用戶:(右鍵單擊SVG圖形預覽源)。

代碼解析:

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