Search code examples
htmlimagemap

Display formatted text in HTML title attribute over imagemap


I have code for an imagemap which has a few links. The code currently looks like this:

<img title = "Concept" border = "0" src = "${concept.png}" usemap = "#myAppMap">

<map name = "myAppMap">

   <area shape = "polygon" coords = "..." title = "title text" />
   <area shape = "polygon" coords = "..." title = "title text" />
   <area shape = "polygon" coords = "..." title = "title text" />
</map>

Where if a user runs a mouse over the area of each shape, the cursor becomes a 'hand' and the title text is displayed. But is it possible to format the title text at all so that I can use line breaks and maybe even lists?


Solution

  • I think you might want to remove the title text and add a mouseover event method that display's a block element on the mouse current's position. In this element you can add whatever you want. This is called a "tooltip" of which there are several to be found on the internet, like jQuery tooltip