Dieser Inhalt wurde automatisch aus dem Englischen übersetzt, und kann Fehler enthalten.Erfahre mehr über dieses Experiment.
color
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since Juli 2015.
Dascolor Attribut wird verwendet, um einen potenziellen indirekten Wert,currentColor, für die Attributefill,stroke,stop-color,flood-color undlighting-color bereitzustellen.
Hinweis:Als Präsentationsattribut hatcolor auch ein entsprechendes CSS-Eigenschaftsgegenstück:color. Wenn beide angegeben sind, hat die CSS-Eigenschaft Vorrang.
Technisch gesehen kanncolor auf jedes Element angewendet werden, aber es hat keine direkte Auswirkung auf SVG-Elemente.
In diesem Artikel
Verwendungshinweise
| Wert | <color> |inherit |
|---|---|
| Standardwert | Hängt vom Benutzeragenten ab |
| Animierbar | Ja |
Beispiel
html,body,svg { height: 100%;}html
<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <g color="green"> <rect width="50" height="50" fill="currentColor" /> <circle r="25" cx="70" cy="70" stroke="currentColor" fill="none" stroke-width="5" /> </g></svg>Spezifikationen
| Specification |
|---|
| CSS Color Module Level 4> # the-color-property> |
| Scalable Vector Graphics (SVG) 2> # ColorProperty> |
Browser-Kompatibilität
Siehe auch
- CSS
colorEigenschaft