The stop-color attribute indicates what color to use at a gradient stop.
[!NOTE] With respect to gradients, SVG treats the
transparentkeyword differently than CSS. SVG does not calculate gradients in pre-multiplied space, sotransparentreally means transparent black. So, specifying astop-colorwith the valuetransparentis equivalent to specifying astop-colorwith the valueblackand a stop-opacity with the value0.
[!NOTE] As a presentation attribute,
stop-coloralso has a CSS property counterpart: stop-color. When both are specified, the CSS property takes priority.
You can use this attribute with the following SVG elements:
- stop
Usage notes
<table class="properties"> <tbody> <tr> <th scope="row">Value</th> <td> color_value </td> </tr> <tr> <th scope="row">Default value</th> <td><code>black</code></td> </tr> <tr> <th scope="row">Animatable</th> <td>Yes</td> </tr> </tbody> </table>
<color>- : This value indicates a color value.
Specifications
Browser compatibility
See also
- CSS stop-color property
- stop-opacity
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
