SVG:use要素
SVG文書の中からノードを取り出して、別の場所に複製する
x="cloned elementの左上隅の x 軸"
y="cloned elementの左上隅の y 軸"
width="the width of the cloned element"
height="the height of the cloned element"
xlink:href="a URI reference to the cloned element"
+ SVG:プレゼンテーション属性
All
<use> - SVG: スケーラブルベクターグラフィック | MDN
<use> - SVG: Scalable Vector Graphics | MDN
HTML5:template要素
SVG:defs要素
https://svg-hosting.vercel.app/api/svg?url=https://scrapbox.io/api/code/suto3/SVG:use要素/u.svg
code:u.svg
<svg viewBox="0 0 30 10" xmlns="http://www.w3.org/2000/svg">
<circle id="myCircle" cx="5" cy="5" r="4" stroke="blue" />
<use href="#myCircle" x="10" fill="blue" />
<use href="#myCircle" x="20" fill="white" stroke="red" />
<!--
stroke="red" will be ignored here, as stroke was already set on myCircle.
Most attributes (except for x, y, width, height and (xlink:)href)
do not override those set in the ancestor.
That's why the circles have different x positions, but the same stroke value.
-->
</svg>
SVG要素.icon