0
我有兩個SVG文件。我試圖將rect.svg的內容鏈接到tst_use.svg。 tst_use.svg的內容,SVG Xlink將不會鏈接到帶有xlink的外部文件:href在<use>標籤
<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?
+0