|
Posted by John Hosking on 07/08/07 08:30
GreatArtist wrote:
> I have internet explorer 7 and firefox 2.
You must be very proud.
> I set my web page to be XHTML 1.0 transitional.
I take it back.
> I put the alt attribute in my image tags but they were only displayed
> in firefox, not IE7.
I do believe that either you've got the browsers backwards or you're
talking about title instead of the al attribute.
> So I changed all the alt attributes to title instead. That works in
> both IE7 and Firefox.
Depends on what you mean by "works."
> But now when I use the W3C xhtml validator, it tells me I should have
> alt for all the image tags.
> Should I include both title and alt in each image tag?
For images which comprise content, yes (I say). Backgrounds no.
Ornamental images are somewhat special; use alt="". See the discussion
at http://www.cs.tut.fi/~jkorpela/html/alt.html.
> Why doesn't alt work in IE7? Didn't alt work in previous versions of
> IE?
"Work," meaning "providing tooltips?" IE has sort of misused alt for
years/versions (maybe forever). But the alt texts are just meant to
stand in for images when they can't be displayed or seen. The title is
what should be used for tooltip-type behavior. AIUI, non-IE browsers
(except e.g. versions of Opera emulating IE) use tooltips based on
title, alternate texts based on alt.
--
John
Pondering the value of the UIP: http://blinkynet.net/comp/uip5.html
[Back to original message]
|