color

  • Revision slug: SVG/Attribute/color
  • Revision title: color
  • Revision id: 17590
  • Created:
  • Creator: Jeremie
  • Is current revision? No
  • Comment page created, 97 words added

Revision Content

« SVG Attribute reference home

The color attribute is used to provide a potential indirect value (currentColor) for the {{ SVGAttr("fill") }}, {{ SVGAttr("stroke") }}, {{ SvgAttr("stop-color") }}, {{ SVGAttr("flood-color") }} and {{ SVGAttr("lighting-color") }} attributes.

As a presentation attribute, it also can be used as a property directly inside a CSS stylesheet, see {{ cssxref("color","CSS color") }} for further information.

Usage context

Categories Presentation attribute
Value <color> | inherit
Animatable Yes
Normative document SVG 1.1 (2nd Edition)

Examples

Elements

The following elements can use the color attribute

  • Text content elements »
  • Shape elements »
  • {{ SVGElement("stop") }}
  • {{ SVGElement("feFlood") }}
  • {{ SVGElement("feDiffuseLighting") }}
  • {{ SVGElement("feSpecularLighting") }}

Revision Source

<p>« <a href="/en/SVG/Attribute" title="en/SVG/Attribute">SVG Attribute reference home</a></p>
<p>The <code>color</code> attribute is used to provide a potential indirect value (<code>currentColor</code>) for the {{ SVGAttr("fill") }}, {{ SVGAttr("stroke") }}, {{ SvgAttr("stop-color") }}, {{ SVGAttr("flood-color") }} and {{ SVGAttr("lighting-color") }} attributes.</p>
<p>As a presentation attribute, it also can be used as a property directly inside a CSS stylesheet, see {{ cssxref("color","CSS color") }} for further information.</p>
<h2 id="Usage_context">Usage context</h2>
<table class="standard-table"> <tbody> <tr> <th scope="row">Categories</th> <td>Presentation attribute</td> </tr> <tr> <th scope="row">Value</th> <td><a href="/en/SVG/Content_type#Color" title="en/SVG/Content_type#Color">&lt;color&gt;</a> | inherit</td> </tr> <tr> <th scope="row">Animatable</th> <td>Yes</td> </tr> <tr> <th scope="row">Normative document</th> <td><a class="external" href="http://www.w3.org/TR/SVG11/color.html#ColorProperty" title="http://www.w3.org/TR/SVG11/color.html#ColorProperty">SVG 1.1 (2nd Edition)</a></td> </tr> </tbody>
</table>
<h2 id="Examples">Examples</h2>
<h2 id="Elements">Elements</h2>
<p>The following elements can use the <code>color</code> attribute</p>
<ul> <li><a href="/en/SVG/Element#Text_content_elements" title="en/SVG/Element#Text_content_elements">Text content elements</a> »</li> <li><a href="/en/SVG/Element#Shape_elements" title="en/SVG/Element#Shape_elements">Shape elements</a> »</li> <li>{{ SVGElement("stop") }}</li> <li>{{ SVGElement("feFlood") }}</li> <li>{{ SVGElement("feDiffuseLighting") }}</li> <li>{{ SVGElement("feSpecularLighting") }}</li>
</ul>
Revert to this revision