我有两个SVG文件。我正在尝试将rect.svg的内容xlink到tst_use.svg中。tst_use.svg的内容是:
<svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xhtml="http://www.w3.org/1999/xhtml" version="1.1" id="svg_hom_img" width="508" height="438">
<use x="0" y="0" id="us_g1_0" width="508" height="438" xlink:href="rect.svg"/>
</svg>rect.svg的内容是,
<svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xhtml="http://www.w3.org/1999/xhtml" version="1.1" id="svg_hom_img" width="508" height="438">
<rect x="0" y="1" width="250" height="250" id="BackDrop" pointer-events="all" style="opacity:1;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:2; stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0"/>
</svg>当然,这两个文件位于同一目录中。我已经尝试了许多组合。代码以内联方式工作。rect.svg将显示在浏览器中。我也可以用javascript把这些文件拼凑在一起。其他人使用此语法。为什么tst_use.svg不能通过xlink连接到rect.svg?
https://stackoverflow.com/questions/44577755
复制相似问题