Actually the correct way of doing this is by using the ARIA role=hidden
.
Like this:
<button type="button">
<span aria-hidden="true" class="icon">></span>
<span class="hide">Go!</span>
</button>
By doing this you hide the > character so screen-readers won't read "right angle bracket", and instead read "Go!". Sighted users will only see > if you hide the content in the .hide class visually.
Like this:
.hide{
position: absolute;
left:-999em;
}
The ARIA role presentation
is for "normalizing" semantic meaning, like for example a <table>
with role="presentation"
won't be read as table content and will be just plain text.
If you want an image not to be read you can put in empty alt
text like this:
<img src="decorative-flower.jpg" alt=""/>
..or if it's an <svg>
omit the <title>
and <description>
<svg>
<!-- <title>Remove this line</title> -->
<!-- <description> Remove this too..</description> -->
</svg>
I have noticed in some rare situations some screen-readers have still read the empty alt images, so you could use aria-hidden="true"
here as well.
CSS' speak property is not supported at this point, and the same goes for the link attribute media="aural".
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…