<circle>
Baseline
Widely available
*
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2015年7月.
* Some parts of this feature may have varying levels of support.
使用上下文
属性
cx-
圆心的 x 轴坐标。值类型:<length> | <percentage>;默认值:
0;动画性:是 cy-
圆心的 y 轴坐标。值类型:<length> | <percentage>;默认值:
0;动画性:是 r-
圆的半径。若值小于或等于 0,则圆形不会被渲染。值类型:<length> | <percentage>;默认值:
0;动画性:是 pathLength-
圆周的总长度,单位为用户单位。值类型:<number>;默认值:无;动画性:是
备注:
从 SVG2 开始,cx、cy 和 r 被视为几何属性,这意味着这些属性也可以作为该元素的 CSS 属性 来使用。
DOM 接口
该元素实现了 SVGCircleElement 接口。
示例
html
<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
<circle cx="50" cy="50" r="50" />
</svg>
规范
| Specification |
|---|
| Scalable Vector Graphics (SVG) 2> # CircleElement> |
浏览器兼容性
Loading…
参见
- 其他 SVG 基本形状:
<ellipse>、<line>、<polygon>、<polyline>、<rect>