问题
In my HTML document I am using roman numbers (e.g.: MMXV = 2015).
Is there a way to inform screen readers to interpret certain text in another way (e.g.: roman numerals as "Two thousand and fifteen" instead of M-M-X-V)?
My guess was that there would be an ARIA attribute, but I cannot seem to find one. E.g.:
<time datetime="2015" aria-?="Two thousand and fifteen">MMXV</time>
回答1:
Use the aria-label tag to give the element a meaningful description.
Then, hide the roman numerals from screen readers by wrapping them in a span
element that has the aria-hidden property set to true
to hide the element from screen readers.
<time datetime="2015" aria-label="Two thousand and fifteen">
<span aria-hidden="true">MMXV</span>
</time>
回答2:
Ok with unobf answer, but you have also to consider that if using aria-label improves accessibility for people using screen readers, it won't increase accessibility for everyone.
You should read point 3.1.4 about abbreviations of the WCAG.
My feeling about this is that roman numbers is a difficult thing to deal with if you really want to be accessible, and not only for blind people. Using an ABBR tag for instance can help people without screenreaders, but ABBR tag aren't focusable element with keyboard (see point 2.1.1) so there isn't an unique problem free solution.
来源:https://stackoverflow.com/questions/28784889/aria-attributes-for-reading-alternative-text-e-g-roman-numerals-in-html