我应该在 的替代文本中重复人名吗?如果名称已经在图像下的源中?

发布于 2024-08-19 11:03:36 字数 600 浏览 8 评论 0原文

如果我已经在图像下方/上方有人名,那么我应该在 ALT 文本中使用相同的名称吗?

替代文本 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>

在这两种情况下,我应该在 alt 中重复 吗?图像没有链接。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

離殇 2024-08-26 11:03:36

是的。

ALT 文本对于屏幕阅读器等很重要。图像“附近”的文本对于这些程序没有多大意义。

W3C 有关该主题的更多信息。

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.

浅沫记忆 2024-08-26 11:03:36

...和

  • 不,我认为您不应该只是重复文本。
  • 但是,您应该ALT属性视为提供图像的(简短)描述的机会,例如“乔治·华盛顿的肖像,布面油画,约 1790 年”。

在这种情况下,图像不仅仅仅用作页面格式。相反,它是一种信息承载元素。无法看到信息的用户(例如屏幕阅读器)至少应该有机会知道他们错过了什么。

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.

还在原地等你 2024-08-26 11:03:36

不可以。重复的内容没有任何帮助。如果图像仅说明普通文本内容中已存在的内容,则它应该具有空白 alt 属性

作为有用的测试,请使用 Lynx 浏览器查看页面。如果它看起来很愚蠢,那么替代文本就是错误的。

如果您复制替代文本(从示例中复制/粘贴),它的呈现方式如下:

    George Washington George Washington

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
坦然微笑 2024-08-26 11:03:36

否。 当图像无法显示时,替代文本将作为图像的替代显示。

以下是规范的摘录,非常简单:

  • 在包含预期图像时,请勿指定不相关的替代文本
    例如,格式化页面
    alt=“红球”是不合适的
    对于添加红球的图像
    装饰标题或段落。在
    在这种情况下,替代案文应
    是空字符串 (””)。作者是
    在任何情况下建议避免使用
    用于格式化页面的图像;样式表
    应该使用它来代替。
  • 不要指定无意义的替代文本(例如,“dummy
    文本”)。这不仅会
    让用户感到沮丧,速度会变慢
    必须转换文本的用户代理
    语音或盲文输出。玩
    终端、浏览器的用户
    不支持表单,视觉上
    受损用户,那些使用
    语音合成器,那些有
    配置他们的图形用户
    代理不显示图像等。

所以它说得很清楚,不要重复。第一种情况中的“红球”可以替换为“乔治·华盛顿”。

这是一篇如何正确使用 alt-attribute 的好文章:Alt 属性

编辑
好吧,我想我被误解了。我并没有说他不能在这里使用替代属性。

我们在这里谈论屏幕阅读器和辅助功能,对吧?我同意图像对我们很重要。但这是给盲人看的吗?或者只是文字的装饰?

请记住,问题是是否在 alt 属性中重复该名称。我说“不”。当未显示图像时,将显示替代文本。我可能会这样做:

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

alt-属性是当图像未显示时的替代,而不是描述(我们对此有描述)。

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

横笛休吹塞上声 2024-08-26 11:03:36

不会有什么坏处——否则屏幕阅读器用户可能会怀疑该图像是否确实是下一个名字的人的图像。

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.

久夏青 2024-08-26 11:03:36

此信息适用于 Windows 版 Jaws,但也可能适用于其他屏幕阅读器。始终将信息放在 alt 标签中。 jaws 识别图形的方式是相当可定制的,您只能说出带有 alt 标签的图形、通过鼠标悬停识别的图形、标题属性等。一般来说,使用默认配置 alt 标签将被说出,任何其他信息都将被忽略。如果 alt 标签不可用,那么屏幕阅读器将尽力阅读图形,但这是有问题的。

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.

层林尽染 2024-08-26 11:03:36

我要在这里使用 alt="" 。

请查看这篇文章,它提供了一个非常好的示例:
http://webaim.org/techniques/alttext/

引用该文章:


alt 属性应该通常:

  • 准确、等效地呈现图像的相同内容和功能。

  • 要简洁。这意味着图像的正确内容(如果有内容)和功能(如果有功能)应该尽可能简洁地呈现。通常不需要超过几个单词,但很少有一两句话可能是合适的。

  • 不得冗余或提供与图像上下文中的文本相同的信息。

  • 不要使用短语“...的图像”或“...的图形”来描述图像。对于用户来说,通常很明显这是一张图像。并且,如果图像正在传达内容,则与文本相反,用户通常不需要知道这是在传达内容的图像。如果图像是照片或插图等是重要内容,则将其包含在替代文本中可能会很有用。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文