color
L'attribut color est utilisé pour définir indirectement une valeur potentielle (currentColor) pour les attributs fill, stroke, stop-color (en-US), flood-color (en-US) et lighting-color (en-US).
Note : color étant un attribut de présentation, il peut être utilisé comme propriété CSS. Voir CSS color pour plus d'informations.
Contexte d'utilisation
| Catégories | Attribut de présentation |
|---|---|
| Valeur | <color> | inherit |
| Animation | Yes |
| Document normatif | SVG 1.1 (2nd Edition) |
Exemple
html
<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg" version="1.1">
<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>
Éléments
Les éléments suivants peuvent utiliser l'attribut color:
Compatibilité des navigateurs
BCD tables only load in the browser