Title tags for images?

  • 1
  • Question
  • Updated 10 years ago
  • Answered
I've read the older posts and I am not clear on this. Can we edit title tags for images? (Typically, tags that generate pop-up text messages.) I know how to edit title tags for pages and ALT tags for images. Thanks!
Photo of Bengo

Bengo

  • 308 Posts
  • 3 Reply Likes
  • feeling a sense of enTITLEment

Posted 10 years ago

  • 1
Photo of Christo

Christo

  • 95 Posts
  • 13 Reply Likes
Hi Bengo

You can edit the alt tag for an image from the property sheet (as I am sure you know). Effectively alt and title tags have the same effect when a browser renders an image - however, according to w3schools, the alt attribute is a 'required' attribute while the title attribute is simply a standard/optional attribute - so alt is actually preferable to title.
See: http://www.w3schools.com/tags/tag_IMG...

Of course, if you *really* want to add a title tag to your image, you can edit the html, your code would look something like:

<img src="happy.gif" alt="happy" title="happy" />


Hope that helps!
Photo of Bengo

Bengo

  • 308 Posts
  • 3 Reply Likes
Thanks. I know title is a low standards priority, but that's not my goal. The functionality they offer is popular in my field, cartooning, where they can be used to reward mousing about by producing hidden text. If there is an alternate way to do that, I'd love to know about it. Pop-up widgets might be one possibility.

In your example above, where would that code be placed? I am not specifically following your guidance in terms of the geographic placement of the code in relation to an image.

I really appreciate all your help.

Bengo
Photo of Christo

Christo

  • 95 Posts
  • 13 Reply Likes
Hi Bengo

The alt attribute should in most cases have the same effect as the title attribute, although it may be browser dependant: Internet Explorer will render alt as tooltext, while FireFox may require a title tag.

I have drafted up a quick example of how you can set the title value to that of the alt value using JavaScript

You can see the tutorial at:
http://tipsandtricks.synthasite.com/t...
Photo of Bengo

Bengo

  • 308 Posts
  • 3 Reply Likes
That's neat!

But how did you isolate it so that just a portion of the image would engage the effect?