Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can you have an 'alt' name for href's like for img's?

Status
Not open for further replies.

newphpbie

Programmer
Oct 17, 2003
110
GB
Lol, the subject isn't exactly great I know, but I tried to be as descriptive as possible.

You know for ...
Code:
<img src=&quot;yourpic.jpg&quot; alt=&quot;A Nice Picture&quot;>

you can use 'alt' to make a string appear when the user holds the mouse over it....

It is possible to do the same thing for href's??

If so, how?

Something like...
Code:
<a href=&quot;[URL unfurl="true"]www.whatever.com&quot;[/URL] alt=&quot;This will take you to Whatever.com&quot;><?a>

??
 
I don't think that alt works. You can use Title=&quot;This will take you to whereEver.com&quot; though and it will work.
 
Ive been able to use alt with image map links as well as regular links. Comes up as a &quot;tool tip&quot; if they hover over it long enough.
 
straybullet, that however is the incorrect behaviour of the IE browser. As Veep stated, nearly every tag can have a title attribute which will appear as a tooltip. In images as well, the alt attribute serves a purpose of displaying the specified text when the image was not loaded and title appears as tooltip. Mozilla for instance does not show alt as tooltip.

<img alt=&quot;Picture of me and my dog&quot; title=&quot;I am the one on the left&quot; src=&quot;meanddog.jpg&quot; width=&quot;500&quot; height=&quot;300&quot; />

<a href=&quot; title=&quot;Click here to search the web&quot;>Search</a>
 
title is the correct attribute to use for all visible HTML entities, although IE shows the alt attribute as a 'tooltip' as well.


Chris.

Indifference will be the downfall of mankind, but who cares?
 
Thanks for all your help guys.

Much appriciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top