Ludwig Weinzierl
Ludwig Weinzierl

Reputation: 16614

How to link from SVG?

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?

Upvotes: 6

Views: 5395

Answers (1)

Erik Dahlstr&#246;m
Erik Dahlstr&#246;m

Reputation: 60966

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.

Upvotes: 15

Related Questions