ellipse

Baseline Widely available *

This feature is well established and works across many devices and browser versions. It’s been available across browsers since January 2020.

* Some parts of this feature may have varying levels of support.

ellipse元素是一个 SVG 基本形状,用来创建一个椭圆,基于一个中心坐标以及它们的x半径和y半径。

椭圆不能指定精确的椭圆倾向(假设,举个例子,你想画一个 45 度角倾斜的椭圆),但是可以利用transform属性实现旋转。

使用上下文

类别基本形状元素、图形元素、形状元素
允许的内容任意数量、任意顺序的下列元素:
动画元素
描述性元素

示例

html
<svg viewBox="0 0 200 100" xmlns="http://www.w3.org/2000/svg">
  <ellipse cx="100" cy="50" rx="100" ry="50" />
</svg>

属性

全局属性

专有属性

DOM 接口

该元素实现了 SVGEllipseElement 接口。

浏览器兼容性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
ellipse
cx
cy
fill
context-fill value
rx
ry
systemLanguage

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support

参见