EPS (justeps) wrote,

  • Mood:

SVG titles in Firefox 2

If I want to title a basic shape so hovering over it will display a tooltip, I should be able to write something like:

<circle cx="75" cy="27" r="6"><title>Hello, World!</title></circle>

...which works as expected in Opera, but Firefox 2 seems to ignore it.

What does produce the desired effect is:

<circle cx="75" cy="27" r="6" xlink:title="Hello, World!" />

The problem here being that it's not valid SVG 1.1. (And I can't seem to find anything I could wrap the <circle> in that's xlink:title-friendly but doesn't require an xlink:href attribute.)

Update: There's a "sleazy" way to fix this:

<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
<!ATTLIST circle
xmlns:xlink CDATA #FIXED "http://www.w3.org/1999/xlink"
xlink:title CDATA #IMPLIED>


<circle cx="75" cy="27" r="6" xlink:title="Hello, World!"><title>Hello, World!</title></circle>

makes both browsers happy.

  • Post a new comment


    Comments allowed for friends only

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded