title属性的可访问性 [英] Accessibility of the title attribute
问题描述
2个问题:
- 我的过去行为是否正确,或者我应该默认使用title属性(如图片上的alt属性)?
- 标题属性对可访问性有多重要?一个谷歌周围发现,他们甚至可能不会被一些屏幕阅读器使用。 根据 根据到 Webaim
根据定义,可以使用title属性提供咨询信息。它应该:
- 不提供可访问性所必需的重要信息或信息。
- 不提供相同的信息可在文本或替代文本中找到。
- 不存在明显的信息。如果顾问头衔没有提供额外的有用信息,则可以将其删除。
- 在小型链接和导航项目上使用时要小心,因为标题工具提示可能会覆盖基础项目。
>
- 不得用作替代文本,表单标签,表
标题等的替换。
- 总是在框架元素上使用
li>
- 不提供相同的信息可在文本或替代文本中找到。
所以基本上你已经走上了正确的道路。更确切地说,它是否真的可以访问比确保它通过所有自动验证器更重要
I've been tasked with making sure a site my company has built meets WCAG 2 AA. I generally write accessible code, and running automated validators usually only highlights typos. I have recently switched validator however, and the new one is highlighting that many of my links don't include title attributes. In the past I have only used the title attribute on links when the link text wasn't entirely self-explanatory by itself.
2 questions:
- Is my past behaviour correct, or should I be using title attributes by default (like alt attributes on images)?
- How important are title attributes for accessibility really? A google around found that they may not even be used by some screen readers.
解决方案According to Webaim
The title attribute, by definition, can be used to provide advisory information. It should:
- NOT provide vital information or information necessary for accessibility.
- NOT provide the same information as is available in text or alternative text.
- NOT present the obvious. If the advisory title does not provide additional, useful information, it can be removed.
- BE used carefully on small links and navigation items because the title tooltip may cover the underlying item.
- NOT be used as a replacement for alternative text, form labels, table headers, etc.
- ALWAYS be used on the frame element
So essentially you've been on the right path. Being more aware of whether or not it is truly accessible is more important than making sure it passes all automatic validators
这篇关于title属性的可访问性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
- 不提供可访问性所必需的重要信息或信息。