我必须将某些SVG文本转换为正常工作的超链接。我有以下代码(我已经添加了锚标记):无法让XLink在SVG文件中工作
<svg class="crocodoc-4Z7fb6 crocodoc-page-svg" version="1.1"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xml:space="preserve" width="720pt" height="547pt" viewBox="0 0 720 547">
<xhtml:link href="css/stylesheet.css" type="text/css" rel="stylesheet" />
<defs>
<image id="Image_35_3_4Z7fb6" width="176" height="243" xlink:href="images/35.png" />
<image id="Image_41_3_4Z7fb6" width="175" height="241" xlink:href="images/41.png" />
<image id="Image_37_3_4Z7fb6" width="176" height="243" xlink:href="images/37.png" />
<clipPath id="Clip_0_3_4Z7fb6"><path d="M0 547 l720 0 l0 -547.2 l-720 0 l0 547.2 " /></clipPath>
<image id="Image_39_3_4Z7fb6" width="176" height="243" xlink:href="images/39.png" />
</defs>
...
<a xlink:href="http://www.mylink.com" target="_blank"><text class="fh" font-size="12.96"
style="fill:#d52b1e"><tspan x="197.66" y="361.55"
textLength="128.81"dx="0,-0.09,-0.09,-0.09,0,0,0,0,0.04,0,0,0,0,0,0.13,0,0,0,0.1,0">
www.mylink.com</tspan></text></a>
...
</svg>
的图像加载不错,但我所包裹着的标记文本,无法点击。任何人都可以建议我在这里做错了吗?
这是可点击我提供的我添加textLength和dx属性之间的缺失空间,即textLength =“128.81”dx =“0,... –
你是对的...它必须是标记中的东西我省略导致它(你提到的空间是在原来的),我会再看一看,并发布完整的文件,如果我不能弄明白,谢谢你的输入。 –