简体   繁体   English

屏幕阅读器不将数字作为单个数字读取

[英]Screen Readers not reading numbers as individual digits

I tried finding answer but no luck.我试图找到答案,但没有运气。 Solutions provided across web is not satisfactory.通过网络提供的解决方案并不令人满意。 Is there any way in Javascript, HTML or CSS to make screen reader to read numbers individually?在 Javascript、HTML 或 CSS 中有什么方法可以让屏幕阅读器单独读取数字吗?

It's reading fine if I put a zero before.如果我之前放零,它的阅读效果很好。

<span>Account #: 0123</span> // Reading correct as 'Zero', 'One', 'Two', 'Three'

<span>Account #: 123</span> // Reading wrong as 'One hundred twenty three'

TL;DR: Please don't do anything. TL;DR:请不要做任何事情。

If you absolutely want to force single-digit reading, you may use aria-label on your span, but actually, please don't do it if there is no absolute and unavoidable need to.如果你绝对想强制读取一位数,你可以在你的span上使用aria-label ,但实际上,如果没有绝对和不可避免的需要,请不要这样做。
The main thing about screen readers is that they convey the same information as your monitor to your eyes.屏幕阅读器的主要特点是它们向您的眼睛传达您的显示器相同的信息。 The key notion here is the same , ie, doing something that would unnecessarily differ from what you see on your monitor is bad in 99.(9)% of cases.这里的关键概念是相同的,即在 99.(9)% 的情况下,做一些与您在显示器上看到的不必要的不​​同的事情是不好的。 I said "unnecessarily" because sometimes it's good to convey additional info: for example, add aria-pressed to a toggle button to mark whether it is pressed or unpressed (which can easily be seen visually with appropriate CSS in place).我说“不必要”是因为有时传达额外的信息很好:例如,将aria-pressed添加到切换按钮以标记它是按下还是未按下(使用适当的 CSS 可以很容易地直观地看到)。
If you believe that your digits are too difficult to perceive and need to be separated, first try to separate them with spaces and look whether it's visually appealing or not.如果您认为您的数字太难感知而需要分开,请先尝试用空格将它们分开,看看它是否具有视觉吸引力。 My feeling is that you will be somewhat irritated to see Account number: 0 1 2 3 instead of the plain 0123 .我的感觉是,您看到Account number: 0 1 2 3而不是普通的0123会有些恼火。 If it's the case, then believe me, a blind user will be irritated too.如果是这样,那么相信我,盲人用户也会被激怒。 If it's OK for you, then go for such a solution, style it appropriately, use non-breaking spaces, but don't do anything special for screen readers in this case.如果这对你来说没问题,那么就去寻找这样的解决方案,适当地设置样式,使用不间断的空格,但在这种情况下不要为屏幕阅读器做任何特别的事情。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM