屏幕阅读器如何阅读< abbr>标签? [英] How do screen readers read <abbr> tags?

查看:76
本文介绍了屏幕阅读器如何阅读< abbr>标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我了解到< abbr> 标签应该由屏幕阅读器解释,以使其 title 属性将在屏幕读取时替换其内容的方式读者.但是,当我尝试这样做时,MacOS(Firefox和Safari)Voiceover或NVDA(Windows 10,Edge和Firefox)都无法正常工作.这是相关的代码部分:

  ... bla bla bla< abbr title ="nervus"> N.</abbr>佩罗纳乌斯... 

(这是一种医学表达方式)

IMO这应该读为"... bla bla nervus peronaeus ...",但应读为"... bla bla blaN.",然后是很长的沉默(或者屏幕阅读器甚至在停下来之前它),显然是因为该点,然后是"peronaeus ..."-没有"nervus" ...

我是否正确使用了语法,或者我缺少什么?或者,如果是正确的话:是否可以添加任何WAI-ARIA代码或类似代码,使其以大多数屏幕阅读器上应有的方式工作?

解决方案

您真的不能完全依赖于用户听到元素的 title 属性.

如您所见,屏幕阅读器通常只读取元素内容.由于 N.包含一个句点,因此它只会读出"N",然后对该句点进行句号停止.您可以将屏幕阅读器设置为读取 title 内容,但这是一个选择启用的设置,因此您不应依赖它.确实没有办法为具有 title 的屏幕阅读器设置内容.

I learned that the <abbr> tag is supposed to be interpreted by screen readers in a way that its title attribute would replace its content when read by a screen reader. However, when I try that, neither MacOS (Firefox and Safari) Voiceover nor NVDA (Windows 10, Edge and Firefox) work that way. Here's the relevant code part:

... bla bla bla <abbr title="nervus">N.</abbr> peronaeus ...

(that's a medical expression)

IMO this should be read as "... bla bla bla nervus peronaeus ...", but it's read as "... bla bla bla N.", then a long silence (or the screen reader even stops before it), apparently because of the dot, and then "peronaeus ..." - no "nervus"...

Am I using the syntax correctly or is there something which I am missing? Or, if that's correct: Is there any WAI-ARIA code or similar which I could add to make it work the way it's suppposed to be on most screen readers?

解决方案

You can't really depend on the user hearing the title attribute of the element. Here's a good resource on how screen readers process HTML elements, and for abbr, the entry is as follows:

As you can see, screen readers usually just read out the element content. Since N. contains a period, it just reads out "N", then does a full stop for the period. You can set up the screen reader to read the title content, but it's an opt-in setting, so you shouldn't depend on it. There's really no way to set content for a screen reader with title.

这篇关于屏幕阅读器如何阅读&lt; abbr&gt;标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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