我应该在 的替代文本中重复人名吗?如果名称已经在图像下的源中?
如果我已经在图像下方/上方有人名,那么我应该在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
是的。
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.
不 ...和是!
ALT
属性视为提供图像的(简短)描述的机会,例如“乔治·华盛顿的肖像,布面油画,约 1790 年”。在这种情况下,图像不仅仅仅用作页面格式。相反,它是一种信息承载元素。无法看到信息的用户(例如屏幕阅读器)至少应该有机会知道他们错过了什么。
No ... and yes!
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.
不可以。重复的内容没有任何帮助。如果图像仅说明普通文本内容中已存在的内容,则它应该具有空白 alt 属性
作为有用的测试,请使用 Lynx 浏览器查看页面。如果它看起来很愚蠢,那么替代文本就是错误的。
如果您复制替代文本(从示例中复制/粘贴),它的呈现方式如下:
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):
否。 当图像无法显示时,替代文本将作为图像的替代显示。
以下是规范的摘录,非常简单:
所以它说得很清楚,不要重复。第一种情况中的“红球”可以替换为“乔治·华盛顿”。
这是一篇如何正确使用 alt-attribute 的好文章:Alt 属性
编辑:
好吧,我想我被误解了。我并没有说他不能在这里使用替代属性。
我们在这里谈论屏幕阅读器和辅助功能,对吧?我同意图像对我们很重要。但这是给盲人看的吗?或者只是文字的装饰?
请记住,问题是是否在 alt 属性中重复该名称。我说“不”。当未显示图像时,将显示替代文本。我可能会这样做:
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:
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:
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.
此信息适用于 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.
我要在这里使用 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.