开发者

Should i repeat person name in alt text of <img> if name is already in source under image?

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

alt text http://easycaptures.com/fs/uploaded/227/6990285751.jpg

<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.


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.


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 is an information-carrying element. Users who cannot see the information (e.g. screen readers) should at least have a chance to know what they're missing.


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


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).


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.


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.


I am going for alt="" here.

Please check this article that provide a very nice examples: http://webaim.org/techniques/alttext/

Quoting from that article:


The alt attribute should typically:

  • Be accurate and equivalent in presenting the same content and function of the image.

  • Be succinct. This means the correct content (if there is content) and function (if there is a function) of the image should be presented as succinctly as is appropriate. Typically no more than a few words are necessary, though rarely a short sentence or two may be appropriate.

  • NOT be redundant or provide the same information as text within the context of the image.

  • NOT use the phrases "image of ..." or "graphic of ..." to describe the image. It usually apparent to the user that it is an image. And if the image is conveying content, it is typically not necessary that the user know that it is an image that is conveying the content, as opposed to text. If the fact that an image is a photograph or illustration, etc. is important content, it may be useful to include this in alternative text.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜