简体   繁体   中英

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.

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". It should not say eg "zero, me", nor simply "zero, 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 :

 <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> 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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