标题属性的可访问性 [英] Accessibility of the title attribute

查看:38
本文介绍了标题属性的可访问性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的任务是确保我公司建立的网站符合 WCAG 2 AA.我通常编写可访问的代码,运行自动验证器通常只会突出显示错别字.然而,我最近更换了验证器,新的验证器强调我的许多链接不包含标题属性.过去,当链接文本本身并不完全自解释时,我只在链接上使用 title 属性.

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 个问题:

  1. 我过去的行为是否正确,还是我应该默认使用标题属性(如图像上的 alt 属性)?
  2. 标题属性对于可访问性究竟有多重要?谷歌搜索发现,某些屏幕阅读器甚至可能不会使用它们.

推荐答案

根据 Webaim

根据定义,title 属性可用于提供咨询信息.它应该:

The title attribute, by definition, can be used to provide advisory information. It should:

  • 不提供重要信息或无障碍所需的信息.
  • 不要提供与文本或替代文本相同的信息.
  • 不呈现明显的.如果建议标题没有提供额外的有用信息,则可以将其删除.
  • 在小链接和导航项上谨慎使用,因为标题工具提示可能会覆盖底层项.
  • 不得用作替代文本、表单标签、表格的替代品标题等
  • 始终用于框架元素

所以基本上你一直在正确的道路上.更清楚它是否真的可以访问比确保它通过所有自动验证器更重要

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

这篇关于标题属性的可访问性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆