Adrienne said:
For those who wonder why a non-empty alt attribute is necessary on an
image element:
I don't think a non-empty alt attribute is necessary on every img element.
And WCAG 2.0 seems to have the same view:
"If non-text content is pure decoration, is used only for visual formatting,
or is not presented to users, then it is implemented in a way that it can be
ignored by assistive technology."
http://www.w3.org/TR/WCAG20/#text-equiv
Today I was filling out a preferences form at Paypal to block certain
types of payments. One of the options was just a small logo that I
could not read because it was too small. Even with magnifying the
page, I still could not make it out. No problem, I thought, I'll
just view the source and take a look at the alt attribute. Guess
what? It was blank!
Well, you could also use some nice browsing enhancement like Firefox Web
Developer Extension, which is very useful in normal browsing, too. In
addition to right-clicking and selecting image information, you could also
select a browsing mode where alt attribute values are shown along with the
images - without needing to peek at the source code (which might not do good
to anyone's mental health).
Anyway, if the alt attribute is present and has empty content, then we
should assume that the proper text replacement for the image is the empty
string, i.e. it can be ignored.
IIRC, alt attributes on logos are usually empty because the company
name is somewhere else in the heading (at least we hope it is),
Right. It's not useful to repeat the information. If the logo is the only
indication of affiliation with a company, then the company name or
abbreviation is suitable alt text, though it might be argued that the
_natural_ way of _saying_ the thing that a logo purports to convey is not
just a name like "Acme", still less something like "Acme logo" but "This is
a page of Acme" or "This page belongs to the Acme site".
but in this case, the logo was the name of some bank (still don't know
what the heck the thing is), so the attribute could have even been
something like "Acme Bank".
Well, here, too, the plain name doesn't really convey an understandable
message. You might say the same about the logo image, but it might be more
understandable than the mere name as text, due to its appearance and
placement.
The alt attribute is not intended to help in interpreting the image, though
we might, as users, try to make such use of it (at our own risk). The
attribute value is normally not meant to be shown when the image is shown.
If an image needs an explanation, the explanation should be given in a
manner that makes it available to all - not necessarily as textual content
on the page, since one might use just a link to the explanation.
I was about to suggest that a title attribute can be used to give
explanations, but that's really not optimal. First, the title attribute
value is normally invisible, with no visual indication of its presence.
Second, it may mess up things; according WCAG 2.0 techniques document, if an
image is ignorable, then it should have, in addition to alt="", either an
empty title attribute or no title attribute at all:
http://www.w3.org/TR/2010/NOTE-WCAG20-TECHS-20101014/H67
So if an image is just decorational or redundant (e.g., a logo that appears
along with a heading that clearly indicates the affiliation that the logo
expresses visually), it would work against accessibility principles to use
either alt or title attribute for describing the image.