If I have a button:
<button>
<svg width="1em" class="inline"><use href="#start-icon"></use></svg>
Start
</button>
Will screen readers ignore <svg>
(which is a desired behavior) or I should hide it (with aria-hidden
, for instance)?
If I have a button:
<button>
<svg width="1em" class="inline"><use href="#start-icon"></use></svg>
Start
</button>
Will screen readers ignore <svg>
(which is a desired behavior) or I should hide it (with aria-hidden
, for instance)?
2
Answers
By default, screen readers will announce the
<svg>
content if it is accessible. So yeah, you should hide it usingaria-hidden
🙂<svg width="1em" class="inline" aria-hidden="true"><use href="#start-icon"></use></svg>
Screen readers will read SVG by default, so you’re right you should use
aria-hidden="true"
to hide it