Forum Moderators: open

Message Too Old, No Replies

ALT text won't work, nor will TITLE tag

I have no idea what I'm doing wrong

         

xamano

12:12 am on Sep 20, 2008 (gmt 0)

10+ Year Member



I can NEVER seem to get either of these to work, and I don't understand what I'm doing wrong. I typed everything like it should be and still NOTHING. I know it's not my browser because I've seen it work for other people.

Can anyone tell me where I've gone wrong? Or maybe what the problem could be if I haven't? I'm so lost, I mean I can live without the alt and title tags but I have never been able to get them to work for me and I'd like to find out why.

Here's one of my link codes:

<span style="margin:0px;padding:0px;border:0px;"><a class="linkopacity image" href="http://www.example.net" target="_blank"><img src="images/previmages/example_previcon.gif" alt="" title="Trigger-Happy" width="99" height="159" style="border:0px"></a></span>

Please and thank you!

[edited by: encyclo at 12:40 am (utc) on Sep. 20, 2008]
[edit reason] examplified, see posting guidelines [/edit]

pageoneresults

12:25 am on Sep 20, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



<a title="Trigger-Happy" class="linkopacity image" href="http://host.example.com" target="_blank"><img src="images/previmages/triggerhappy_previcon.gif" alt="Trigger Happy" width="99" height="159" style="border:0px"></a>

The alt attribute is for describing the image. The title attribute is typically used to describe the destination of a link if required. In your case, the title attribute would be assigned to the a href and the alt to the image. It is one or the other from my perspective. And, when it comes to that title attribute, you typically use it very sparingly. Usually in places where you cannot spell out the anchor text due to space limitations. At least you can provide the user with what some refer to as a "tool tip" to enhance their understanding of the link itself.

The alt attribute will display on hover in IE, that is not the correct behavior. The alt attribute will not display on hover in other browsers like FF. It is meant to be seen when images are turned off and a text representation is present to describe what is normally there in image format.

g1smd

12:39 am on Sep 20, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I add the alt text only to the img element.

I add title text only to the link/anchor element.

As P1R says, the alt text pop-up action on IE is basically a bug.

It is the title attribute that should pop up on mouseover.

xamano

2:28 am on Sep 20, 2008 (gmt 0)

10+ Year Member



IT WORKS! YES! Thank you guys SO much! That's been bugging me forever, haha.

g1smd

8:28 am on Sep 20, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



It's the fact that alt text pops up on IE that confuses people the most... they think that is what should happen; and are often surprised to find out that it is the title text that should do that as per the official specs.