RE: ALT and TITLE as required attribute, that should be lowercase if you are using xhtml

On Tue, 4 Feb 2003, Jon Hanna wrote:

> Since title is "additional
> information" it should never be the same as alt.

I don't think title is defined as "additional information"; it's defined
as "advisory title", which is rather vague, but it surely does not imply
the requirement that it contain additional information.

Some people even use title="" to suppress (on some browsers) the tooltip
effect of alt="...". It's not logical, but neither can we comdemn them; if
it's the price for persuading people into writing useful alt attributes,
let's pay it.

But primarily, I would say that for <img>, the title attribute should be a
title, a caption-like text, for the image. This is _not_ self-evident,
since <img> could be seen as a dual element with two manifestations, the
other face of Janus being the alt text. But I think we can safely say that
<img> is primarily for image inclusion, and the title attribute could
legitimately reflect this.

In practical terms, I would say that title="..." is mainly suitable for
extra information about an image, in situation where that information
is not necessary but just "nice to have" available. As a consequence,
there's on particular reason why it couldn't say the same as alt="...".
I'm mainly thinking of situations where a "real" alt text cannot be
written but a description has to do, e.g.
<img alt="[My photo]" title="My photo" src="me.jpg">
(Using alt="" is another option, but it might be relevant that people who
hae just switched images off know about the presence of a photo.)
Here the title, when shown e.g. as a tooltip, would explain to the user
that it's really the page owner's photo. Of course, the title attribute
could be more informative, e.g.
title="Photo of J. Korpela, taken in 1957"

> This moves from theoretical
> nit-picking to a real-world problem when you have an image inside a link,
> since those browsers with the design-flaw that causes alts to be used as
> titles will display the alt as a tooltip, or whatever mechanism they use for
> titles, rather than the title for the link.

I think it depends. But a confusion is surely possible. And it's best to
avoid title texts in such contexts. After all, what could an image for a
company logo be, for example. Logically, it should be _about the image_,
whether it's a link or not. Actually some company logos would really
benefit from titles that explain what the logo really is, graphically.
But in practice, if such explanations are given, they are best given on a
separate page, linked to with link text like "About of company logo".

-- 
Jukka "Yucca" Korpela, http://www.cs.tut.fi/~jkorpela/

Received on Tuesday, 4 February 2003 12:07:39 UTC