我找不到如何在SVG文档中嵌入两个SVG的方法。我需要做它与代码的能力,这将与两个子SVG操作的能力,并希望在这两个领域有独立的坐标。我不喜欢使用HTML,因为我认为与SVG相比,它的局限性太大了。非常感谢!
发布于 2011-11-07 14:15:26
SVG文档片段由“SVG”元素中包含的任意数量的
元素组成。
来源:http://www.w3.org/TR/SVG/struct.html#NewDocument
基本上:
<svg …>
<svg id="a" …>…</svg>
<svg id="b" …>…</svg>
</svg>发布于 2013-11-14 19:35:01
<svg>
...
<image x="..." y="..." width="..." height="..." xlink:href="path/to/your/file.svg" ></image>
...
</svg>发布于 2014-12-18 20:18:37
一种解决方案是“父svg -g-子svg”结构。
<svg>
<g transform="translate(-,-)">
<svg>
...
</svg>
</g>
</svg>您可以将子svg的坐标设置为g元素的transform(translate)。
演示:
http://hitokun-s.github.io/old/demo/path-between-two-svg.html
https://stackoverflow.com/questions/8028746
复制相似问题