Alt on text???

liunx

Guest
I'm sure that somehow you can make alt text appear over hyperlinks....but how do you do it? I tried adding the alt="ertreter" bit in the href tag, but that didn't work. Is there some kind of javascript or something I need?<br />
<br />
Andy<!--content-->this should work fo rya<br />
<br />
<HTML><HEAD><br />
<br />
<SCRIPT language=JavaScript><br />
<br />
function showtip(current,e,text)<br />
{<br />
<br />
if (document.all)<br />
<br />
{<br />
thetitle=text.split('<BR>')<br />
<br />
if (thetitle.length>1)<br />
<br />
{<br />
thetitles=''<br />
<br />
<br />
for (i=0;i<thetitle.length;i++)<br />
thetitles+=thetitle<br />
current.title=thetitles<br />
}<br />
else<br />
{current.title=text}<br />
}<br />
else if (document.layers)<br />
{<br />
document.tooltip.document.write('<layer bgColor="white" style="border:1px solid black;font-size:12px;">'+text+'</layer>')<br />
document.tooltip.document.close()<br />
document.tooltip.left=e.pageX+5<br />
document.tooltip.top=e.pageY+5<br />
document.tooltip.visibility="show"<br />
}<br />
<br />
}<br />
<br />
<br />
function hidetip()<br />
{<br />
if (document.layers)<br />
document.tooltip.visibility="hidden"<br />
}<br />
<br />
</SCRIPT><br />
<br />
<STYLE type=text/css><br />
A {COLOR: blue; TEXT-DECORATION: none}<br />
A:hover {COLOR: orange; TEXT-DECORATION: none}<br />
</STYLE><br />
<br />
</HEAD><br />
<br />
<br />
<BODY><br />
<DIV id=tooltip style="VISIBILITY: hidden; POSITION: absolute"></DIV><br />
<A href=http://www.htmlforums.com/archive/index.php/"link.html" onmouseover="showtip(this,event,'this is a working tooltip')" onmouseout=hidetip()>Run your mouse over here !!!</a><br />
</BODY><br />
<br />
</HTML><!--content-->The code for having an alt tag over a hypertext link is title. Use it the same way you would as a alt.<br />
<br />
For example:<br />
<a href=http://www.htmlforums.com/archive/index.php/"home.html" title="Go Home"><br />
<br />
I haven't tested it in NS or IE 4.x-, but it works in IE 5.x<!--content-->and you could use this for any plain text:<br />
<br />
<acronym title="Home">Home</acronym><!--content-->Wow, that isa great :) <br />
<br />
Thanks everyone for your help :) I never knew you could do it to normal text too...lol<br />
<br />
Andy<!--content-->Originally posted by BloodGhst <br />
The code for having an alt tag over a hypertext link is title. Use it the same way you would as a alt.<br />
<br />
For example:<br />
<a href=http://www.htmlforums.com/archive/index.php/"home.html" title="Go Home"><br />
<br />
I haven't tested it in NS or IE 4.x-, but it works in IE 5.x <br />
does not work in NS4.77 but it does in NS 6.1<br />
<br />
and <br />
<acronym title="Home">Home</acronym><br />
doesn't work in NS4.77 either but it does in 6.1<!--content-->Originally posted by scoutt <br />
<br />
does not work in NS4.77 but it does in NS 6.1<br />
<br />
and <br />
<acronym title="Home">Home</acronym><br />
doesn't work in NS4.77 either but it does in 6.1 <br />
<br />
That's good to know. Thanks.<!--content-->
 
Back
Top