EPS (justeps) wrote,
EPS
justeps

  • 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"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"
[
<!ATTLIST circle
xmlns:xlink CDATA #FIXED "http://www.w3.org/1999/xlink"
xlink:title CDATA #IMPLIED>
]>

Then,

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

makes both browsers happy.

Subscribe
  • Post a new comment

    Error

    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 

  • 0 comments