简体   繁体   English

屏幕阅读器可访问类似密码的文本

[英]Screen reader accessibility for password-like text

In some situations you want to render an alphanumeric code or other such text which should be reproduced elsewhere exactly, where eg the case of each character is important. 在某些情况下,您希望呈现一个字母数字代码或其他此类文本,这些文本应准确地在其他地方重现,例如,每个字符的大小写很重要。 You may markup each character separately and apply styles to more easily distinguish O0 , 1Il , etc. 您可以单独标记每个字符,并应用样式更容易区分O01Il等。

However, how would a screen reader or similar accessibility tool read this? 但是,屏幕阅读器或类似的辅助功能工具将如何读取此信息? Ideally I'd want this to be read as something like "zero, uppercase em, lowecase ee". 理想情况下,我希望将其读为“零,大写em,小写ee”。 It should not say eg "zero, me", nor simply "zero, em, ee". 它不应该说“零,我”,也不能简单地说“零,em,ee”。

 <span class="token"><!-- --><span class="token-d">0</span><!-- --><span class="token-u">M</span><!-- --><span class="token-l">e</span><!-- --></span> 

You could use aria-label : 您可以使用aria-label

 <span aria-label="Uppercase A">A</span><!-- --><span aria-label="Lowercase l">l</span><!-- --><span aria-label="3">3</span><!-- --><span aria-label="lowercase x">x</span> 

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

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