Forum Moderators: open
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]
<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.