Baseline Widely available *
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
* Some parts of this feature may have varying levels of support.
用来定义径向渐变,以对图形元素进行填充或描边。
备注:
不要与 CSS radial-gradient()
混淆,CSS 渐变只能应用在 HTML 元素上,而 SVG 渐变只能运用在 SVG 元素上。
示例
html
属性
cx
cy
fr
fx
fy
gradientUnits
-
这个属性定义了
cx
、cy
、r
、fx
、fy
、fr
属性的坐标系统;值类型:userSpaceOnUse
|objectBoundingBox
;默认值:objectBoundingBox
;动画性:有 gradientTransform
-
这个属性为梯度坐标系提供了额外的变换。值类型:
;默认值:identity transform;动画性:有 href
r
-
这个属性定义了径向渐变的终点圆的半径。梯度的绘制将使 100% 的
被映射到终点圆的周长。值类型:;默认值: 50%
;动画性:有 spreadMethod
-
这个属性表明,如果渐变在包含渐变的形状的边界内开始或结束,它将如何表现。值类型:
pad
|reflect
|repeat
;默认值:pad
;动画性:有 xlink:href
已弃用
使用上下文
类别 | 渐变元素 |
---|---|
允许的内容 | 任意数量、任意顺序的下列元素: 描述性元素 、 、 、 、 、 、
|
规范
Specification |
---|
Scalable Vector Graphics (SVG) 2 # RadialGradientElement |