This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The <solidcolor> SVG element lets authors define a single color for use in multiple places in an SVG document. It is also useful as away of animating a palette colors.

Note: This is an experimental technology, and not yet implemented in browsers. A workaround is to use a <linearGradient> with only one color stop. This is less elegant, and unlike <solidcolor>, cannot itself be used in the definition of gradients.

Usage context



Global attributes

Specific attributes


DOM interface

This element implements the SVGSolidcolorElement interface.



<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300 200" height="150">
    <!-- solidColor is experimental. -->
    <solidcolor id="myColor" solid-color="gold" solid-opacity="0.8"/>
    <!-- linearGradient with a single color stop is a less elegant way to 
         achieve the same effect, but it works in current browsers. -->
    <linearGradient id="myGradient">
      <stop offset="0" stop-color="green" />
  <text x="10" y="20">Circles colored with solidColor</text>
  <circle cx="150" cy="65" r="35" stroke-width="2" stroke="url(#myColor)"
  <circle cx="50" cy="65" r="35" fill="url(#myColor)"/>

  <text x="10" y="120">Circles colored with linearGradient</text>
  <circle cx="150" cy="165" r="35" stroke-width="2" stroke="url(#myGradient)"
  <circle cx="50" cy="165" r="35" fill="url(#myGradient)"/>



Specification Status Comment
Scalable Vector Graphics (SVG) 2
The definition of '<solidcolor>' in that specification.
Candidate Recommendation Initial definition

Browser compatibility

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

Feature Chrome Edge Firefox (Gecko) Internet Explorer Opera Safari
Basic support ? ? ? ? ? ?
Feature Android Edge Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support ? ? ? ? ? ?

See also

Document Tags and Contributors

 Contributors to this page: Sebastianz, bunnybooboo, y6nH
 Last updated by: Sebastianz,