HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
Creating img title tags from the img alt tag
Post new topic   Reply to topic    HTML Help Forum Index -> HTML Tools
View previous topic :: View next topic  
Author Message
colinshead



Joined: 17 Sep 2007
Posts: 13
Location: Near Colchester in the UK

PostPosted: Tue Dec 11, 2007 12:08 pm     Creating img title tags from the img alt tag Reply with quote

Hi

I have lots of pages with image links that include the 'alt' tag. To display tool tips correctly also need the img 'title' tag which in content terms is identical to the alt tag.

For example <img src="photo.gif" width="100" height="50" title="Title of Photo" alt="Title of Photo" /></a>

Has anyone found a neat tool to go through html pages and add a 'title' tag, whenever it finds an 'alt' tag, i.e. essentially duplicates the 'alt' tag.

To do this by manually editing the html takes hours!
sticks464



Joined: 31 Dec 2006
Posts: 930

PostPosted: Tue Dec 11, 2007 4:04 pm     Reply with quote

colinshead
Quote:
To display tool tips correctly also need the img 'title' tag which in content terms is identical to the alt tag.

Incorrect. The title tag will display a tooltip(as will the alt tag) however the alt tag is a requirement for accessibility for visually impaired persons using screen readers to display alternate text in the absence of images, the title tag will not display this text. However you can use both tags to achive your purpose.
colinshead



Joined: 17 Sep 2007
Posts: 13
Location: Near Colchester in the UK

PostPosted: Wed Dec 12, 2007 12:21 am     Reply with quote

Hi
Yes I am aware of the role of the tags, but I am looking for a way of creating title tags 'automatically' by copying the 'alt' tags as the content of the tags will be the same.

Problem is that Firefox only displays tool tips from the title tag, not the alt tag.

The alt tag is actually incorrectly used by IE to display tool tips, it is intended only to cause a text display when images are disabled.

This is just to save going through the code manually and typing in the title tag on every image (I have hundreds to deal with).
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> HTML Tools All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
 
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial