fill-opacity
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since March 2020.
Das fill-opacity
Attribut ist ein Präsentationsattribut, das die Opazität des Mal-Servers (color, gradient, pattern usw.) definiert, der auf eine Form angewendet wird.
Hinweis:
Als Präsentationsattribut hat fill-opacity
auch ein entsprechendes CSS-Attribut: fill-opacity
. Wenn beide angegeben sind, hat die CSS-Eigenschaft Priorität.
Sie können dieses Attribut mit den folgenden SVG-Elementen verwenden:
Beispiel
<svg viewBox="0 0 400 100" xmlns="http://www.w3.org/2000/svg">
<!-- Default fill opacity: 1 -->
<circle cx="50" cy="50" r="40" />
<!-- Fill opacity as a number -->
<circle cx="150" cy="50" r="40" fill-opacity="0.7" />
<!-- Fill opacity as a percentage -->
<circle cx="250" cy="50" r="40" fill-opacity="50%" />
<!-- Fill opacity as a CSS property -->
<circle cx="350" cy="50" r="40" style="fill-opacity: .25;" />
</svg>
Nutzungshinweise
Wert |
[0-1] |
<percentage>
|
---|---|
Standardwert | 1 |
Animierbar | Ja |
Hinweis:
SVG2 führt Prozentwerte für fill-opacity
ein, diese werden jedoch noch nicht breit unterstützt (siehe Browser-Kompatibilität unten). Aus diesem Grund ist es Praxis, die Opazität mit einem Wert im Bereich [0-1]
festzulegen.
Spezifikationen
Specification |
---|
Scalable Vector Graphics (SVG) 2 # FillOpacity |
Browser-Kompatibilität
Siehe auch
- CSS
fill-opacity
Eigenschaft opacity
stop-opacity
stroke-opacity