views:

143

answers:

6

if I'm already having person name under/over image then should i use same name in ALT text?

alt text

<p><img width="125" height="157" alt="George Washington" 
src="media/gw.jpg"><span>George Washington</span><p>


<p><span>George Washington</span>
<img width="125" height="157" alt="George Washington" src="media/gw.jpg"><p>

Should i repeat <span> in alt in both condition ? image has no link.

+9  A: 

Yes.

ALT Text is important for screen readers and such. Text 'nearby' to an image doesn't have much meaning to these programs.

Some more information from W3C on the subject.

kervin
but screen reader will repeat same name in ALT="person name" and <p>person name?
metal-gear-solid
The screen reader can let the user know that there is a image on the page and it pertains to 'whatever is in ALT'. So the user know has a little knowledge about what they're missing. It will then continue with the page. Without that ALT, the user would never know what was in the image.
kervin
+1 Agree. However, I would use the `ALT` attribute to provide a *description* of the image, e.g. "Portrait of George Washington, oil on canvas, circa 1790".
jensgram
I disagree. And so does the W3C:"Do not specify irrelevant alternate text when including images intended to format a page, for instance, alt=”red ball” would be inappropriate for an image that adds a red ball for decorating a heading or paragraph. In such cases, the alternate text should be the empty string (”")." "Red Ball" in this case "George Washington"
Nils Riedemann
@Nils: It *is not* irrelevant in W3C's terms. The image here does matter and is a necessary component to understand the content. The spec refers to cases, where the image is merely decoration.
Boldewyn
@Nils Riedermann "... images intended to format a page ...". This is not the case - at least as far as I understood the question.
jensgram
@jensgram: I was up to write exactly this ('...as an description...') as an answer. Good you pointed it out.
Boldewyn
Updated my answer. I think i got misunderstood. Sorry for that.
Nils Riedemann
+1  A: 

Wouldn't hurt -- otherwise the screenreader user might be left to wonder if the image is in fact that of the person whose name comes next.

Jay
+1  A: 

This info pertains to Jaws for windows but probably applys to other screen readers as well. Always put information in an alt tag. How jaws recognizes graphics is fairly customizable, you can have only graphics with alt tags spoken, graphics recognized by mouse over, title attribute, etc. In general with the default configuration alt tags will be spoken and any other information will be ignored. If an alt tag isn't available then the screen reader will do it's best to read the graphic but this is problamatic.

Jared
but if alt text is not defined in image then screen will read text which is after the image
metal-gear-solid
+2  A: 

No. Duplicate content is unhelpful. If an image merely illustrates something which already exists in the normal text content, it should have a blank alt attribute

As a useful test, use the Lynx browser to look at the page. If it looks stupid, the alt text is wrong.

Here is how it renders if you duplicate the alt text (copy/pasted from your example):

    George Washington George Washington
David Dorward
+1  A: 

No. Alt Text is shown as an alternative for the image when it cannot be shown.

Here is an extract from the specification that is quite straight forward:

  • Do not specify irrelevant alternate text when including images intended
    to format a page, for instance,
    alt=”red ball” would be inappropriate for an image that adds a red ball for decorating a heading or paragraph. In such cases, the alternate text should be the empty string (”"). Authors are in any case advised to avoid using
    images to format pages; style sheets
    should be used instead.
  • Do not specify meaningless alternate text (e.g., “dummy text”). Not only will this frustrate users, it will slow down user agents that must convert text to speech or braille output. play terminals, users whose browsers don’t support forms, visually impaired users, those who use speech synthesizers, those who have configured their graphical user
    agents not to display images, etc.

So it says pretty clear not to repeat. "Red Ball" in the first case can be replaced by "George Washington".

Here is a good article how to use the alt-attribute properly: Alt attributes

EDIT: Ok i think i got misunderstood. I did not say that he mustn't use an alt-attribute here.

We are talkin about screen readers and accessibilty here, right? I agree the image is important to us. But is it to blind people? Or is it just decoration for the text?

Remember the question was wether to repeat the name in the alt attribute. And i say "No". When images are not shown, the alt-text is displayed. I'd propably do it this way:

<p><img src="george.jpg" alt="Image of " />George Washington</p>

The alt-Attribute is the alternative for when the image is not shown and not a description (we have description for this).

Nils Riedemann
Why a votedown? O_o
Nils Riedemann
-1 This question is not about whether to use `ALT` text on "images intended to format a page". The image of George Washington is part of the information on the page and the `ALT` text gives the author an opportunity to *describe* what some viewers do not see.
jensgram
I updated my answer and made my point clearer, i hope. Maybe you can remove the downvote now? ;)
Nils Riedemann
Indeed. (filler to reach 15 chars)
jensgram
+2  A: 

No ... and yes!

  • No, I my opinion you should not just repeat the text.
  • However, you should see the ALT attribute as an opportunity to provide a (short) description of the image, e.g. "Portrait of George Washington, oil on canvas, circa 1790".

It this case the image does not only serve as page formatting. Instead, it's an information carrying element. Users who are not able to see the information (e.g. screen readers) should at least have a chance to know what they're missing.

jensgram