Accessibility of the title attribute

前端 未结 2 831
梦毁少年i
梦毁少年i 2021-01-14 07:01

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 t

相关标签:
2条回答
  • 2021-01-14 07:19

    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

    0 讨论(0)
  • 2021-01-14 07:32

    Title attributes should be used for supplementary descriptive information when a link's content is not overly intuitive. It appears that your previous use is acceptable.

    0 讨论(0)
提交回复
热议问题