Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to link from SVG?

Tags:

svg

xlink

What I tried is this

<a xlink:target="http://ponyoverflow.com">
  <text class="text" x="20" y="718" text-anchor="start">Mail Order Ponies</text>
</a>

and variations with href and type="simple".

The link text appears, but the link is not clickable. I tried Firefox 3.5.5, Chromium, Inkscape and GNOME Image Viewer.

Is there anything wrong with the syntax and if not is there any application that supports links in SVG?

like image 922
Ludwig Weinzierl Avatar asked Nov 29 '09 18:11

Ludwig Weinzierl


1 Answers

Try this:

<a xlink:href="http://ponyoverflow.com">
  <text class="text" x="20" y="718" text-anchor="start">Mail Order Ponies</text>
</a>

...and make sure you have an attribute xmlns:xlink="http://www.w3.org/1999/xlink" on the svg root element.

like image 125
Erik Dahlström Avatar answered Nov 15 '22 09:11

Erik Dahlström