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

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

问题描述

我一直负责确保我公司建造的网站符合WCAG 2 AA。我通常编写可访问的代码,运行自动验证器通常只会突出显示拼写错误。不过,我最近更换了验证程序,而新版本强调我的许多链接不包含标题属性。在过去,我只在链接上使用title属性,当链接文本本身并不完全是自我解释。



2个问题:


  1. 我的过去行为是否正确,或者我应该默认使用title属性(如图片上的alt属性)?
  2. 标题属性对可访问性有多重要?一个谷歌周围发现,他们甚至可能不会被一些屏幕阅读器使用。 根据 根据到 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:

    1. Is my past behaviour correct, or should I be using title attributes by default (like alt attributes on images)?
    2. 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屋!

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