The SVGGradient interface is a base interface used by SVGLinearGradientElement and SVGRadialGradientElement.
On this page
SVGGradientElement
Constants
| Name | Value | Description |
|---|---|---|
SVG_SPREADMETHOD_UNKNOWN |
0 | The type is not one of predefined types. It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. |
SVG_SPREADMETHOD_PAD |
1 | Corresponds to value pad. |
SVG_SPREADMETHOD_REFLECT |
2 | Corresponds to value reflect. |
SVG_SPREADMETHOD_REPEAT |
3 | Corresponds to value repeat. |
Instance properties
This interface also inherits properties from its parent, SVGElement.
SVGGradientElement.hrefRead only-
An
SVGAnimatedStringcorresponding to thehreforxlink:hrefDeprecated attribute of the given element. SVGGradientElement.gradientUnitsRead only-
An
SVGAnimatedEnumerationcorresponding to thegradientUnitsattribute on the given element. This property takes one of the constants defined inSVGUnitTypes. SVGGradientElement.gradientTransformRead only-
An
SVGAnimatedTransformListcorresponding to thegradientTransformattribute on the given element. SVGGradientElement.spreadMethodRead only-
An
SVGAnimatedEnumerationcorresponding to thespreadMethodattribute on the given element. One of the spread method types defined on this interface.
Instance methods
This interface does not provide any specific methods, but implements those of its parent, SVGElement.
Specifications
Browser compatibility
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
SVGGradientElement |
1 | 12 | 1.5 | 9 | ≤12.1 | 3 | 3 | 18 | 4 | ≤12.1 | 1 | 1.0 |
gradientTransform |
1 | 12 | 1.5 | 9 | ≤12.1 | 3 | 3 | 18 | 4 | ≤12.1 | 1 | 1.0 |
gradientUnits |
1 | 12 | 1.5 | 9 | ≤12.1 | 3 | 3 | 18 | 4 | ≤12.1 | 1 | 1.0 |
href |
1 | 12 | 2 | 9 | ≤12.1 | 3 | 3 | 18 | 4 | ≤12.1 | 1 | 1.0 |
spreadMethod |
1 | 12 | 1.5 | 9 | ≤12.1 | 3 | 3 | 18 | 4 | ≤12.1 | 1 | 1.0 |
© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/SVGGradientElement