<lineargradient>
<radialgradient>
<stop>
<feBlend>
<feColorMatrix>
<feComponentTransfer>
<feComposite>
<feConvolveMatrix>
<feDiffuseLighting>
<feDisplacementMap>
<feDistantLight>
<feFlood>
<feFuncA>
<feFuncB>
<feFuncG>
<feFuncR>
<feGaussianBlur>
<feImage>
<feMerge>
<feMergeNode>
<feMorphology>
<feOffset>
<fePointLight>
<feSpecularLighting>
<feSpotLight>
<feTile>
<feTurbulence>
<filter>
<font>
<font-face>
<font-face-format>
<font-face-name>
<font-face-src>
<font-face-uri>
<foreignObject>
The SVG
<stop>
element defines a color and its position to use on a gradient. This element is always a child of a
<linearGradient>
or
<radialGradient>
元素。
<svg viewBox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<linearGradient id="myGradient" gradientTransform="rotate(90)">
<stop offset="5%" stop-color="gold" />
<stop offset="95%" stop-color="red" />
</linearGradient>
</defs>
<!-- using my linear gradient -->
<circle cx="5" cy="5" r="4" fill="url('#myGradient')" />
</svg>
offset
This attribute defines where the gradient stop is placed along the gradient vector.
Value type
:
<number>
|
<percentage>
;
默认值
:
0
;
Animatable
:
yes
stop-color
This attribute defines the color of the gradient stop. It can be used as a CSS property.
Value type
:
currentcolor
|
<color>
|
<icccolor>
;
默认值
:
black
;
Animatable
:
yes
stop-opacity
This attribute defines the opacity of the gradient stop. It can be used as a CSS property.
Value type
:
<opacity>
;
默认值
:
1
;
Animatable
:
yes
Most notably:
id
class
,
style
Global event attributes , Document element event attributes
Most notably:
color
,
display
,
stop-color
,
stop-opacity
,
visibility
| 类别 | Gradient element |
|---|---|
| 准许内容 |
Any number of the following elements, in any order:
<animate>
,
<animateColor>
,
<set>
|
| 规范 |
|---|
|
Scalable Vector Graphics (SVG) 1.1 (Second Edition)
(SVG)
# GradientStops |
BCD tables only load in the browser
最后修改: , 由 MDN 贡献者