• 首页
  • vue
  • TypeScript
  • JavaScript
  • scss
  • css3
  • html5
  • php
  • MySQL
  • redis
  • jQuery
  • SVG 圆形

    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>
    

    代码解析:

    • cx和cy属性定义圆点的x和y坐标。如果省略cx和cy,圆的中心会被设置为(0, 0)
    • r属性定义圆的半径

    上篇:SVG 矩形

    下篇:SVG 椭圆