How to put in special characters in ALT

I read in another post that since text popups for action hotspots don’t work on the web, that you should modify the HTML attributes, on the ‘picture/icon’ and put in a line like…

ALT = “This will work on the web”

So far this has been perfect, however, i would like to have some special characters like a Carriage Return and tab as well. Naturally I tried \n and \t, but they display as such.

Anybody done this before? Thanks John

Subject: How to put in special characters in ALT

No can do – neither the alt not the title attribute support formatting. That being said, there is a JS workaround that can replace your alt/title with a DHTML “pop-up” (a div that appears on mouseover) tool tip. Dustin Diaz uses the technique on his site:

http://www.dustindiaz.com/

ADDED: The dealy you’re looking for is called “Sweet Titles”.

Subject: RE: How to put in special characters in ALT

thats some piece of code. I’ll have to spend some time to understand what he is doing. While it looks great, I could seem to find out how he is doing it. Maybe I can put this in place the next phase of the project.

John

Subject: RE: How to put in special characters in ALT

While its true that the ALT attribute do not support formatting, I believe a new line can be inserted using and a tab by

like so:

<img width=64 height=64 alt="Hello

World" src=“c:\image001.gif”>

This does work on IE 6, not sure if its supported on all web browsers.

Subject: RE: How to put in special characters in ALT

Thanks for the response. I was hoping there was an easy way to put it into the alt tag. The method that Stan gave look really nice, the Javascipt in there is just a little over my head.

John

Subject: RE: How to put in special characters in ALT

Must thank Stan for the link to Dustin Diaz’s site. I also use WZ tooltip from

In fact if all you need is to just enter a new line, you can use the special chracters

( for a tab) like so:

alt = "My first line

My Second line"

Agreed it does not look as jazzy as the solution provided in the above 2 links :slight_smile: