4 ms·
What exactly don't you understand? I find the W3C specs fairly well-written, actually. You declare a symbol in the defs section of an SVG image and you can ins
by ygra 13y ago
What exactly don't you understand? I find the W3C specs fairly well-written, actually.
You declare a symbol in the defs section of an SVG image and you can instantiate it with use. E.g.
<svg>
<defs>
<symbol id='foo'>
<circle r='5' cx='10' cy='3'/>
</symbol>
</defs>
<use xlink:href='#foo' x='2' y='5'/>
<use xlink:href='#foo' x='10' y='10' fill='red' stroke='blue'/>
</svg>
(does not actually work, because namespaces are missing and the symbol likely is missing things like a viewbox, but just to get the general idea across)