使用語境
屬性
offset-
此屬性定義漸變停止點在漸變向量上的位置。值型別:<number> | <percentage>;預設值:
0;可動畫:是 stop-color-
此屬性定義漸變停止點的顏色。它可以作為 CSS 屬性使用。值型別:<color>;預設值:
black;可動畫:是 stop-opacity-
此屬性定義漸變停止點的透明度。它可以作為 CSS 屬性使用。值型別:<opacity-value>;預設值:
1;可動畫:是
DOM 介面
此元素實現了 SVGStopElement 介面。
示例
html
<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>
規範
| 規範 |
|---|
| Scalable Vector Graphics (SVG) 2 # StopElement |
瀏覽器相容性
載入中…