【发布时间】:2019-09-25 16:01:12
【问题描述】:
我尝试了该代码,但“要引用的文本”从未显示在屏幕上,可能是因为不推荐使用 xlink;您知道如何更新该代码以使其正常工作吗?或者我应该使用什么函数来代替 xlink:href ? 提前非常感谢你:)
<svg xmlns="http://www.w3.org/2000/svg" version="1.0"
xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<text id="Textref">
The text to be referenced to
</text>
</defs>
<text x="20" y="20" font-size="30" fill="#9d1d20" >
Inline text
</text>
<text x="20" y="40" font-size="30" fill="red" style="text-decoration:underline;">
<tref xlink:href="#Textref"/>
</text>
</svg>
【问题讨论】: