You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Anchors must have content and the content must be accessible by a screen reader
That makes sense for this:
<ahref="#example"><divclass="box"></div></a>
But if you are doing a purely presentational image with clickable zones and want screen readers to skip the section entirely, you can add role="presentation" and aria-hidden:
This is pointless though, as the text exists for screen readers, but the screen reader will not ever see it.
Also the tabindex="-1" is important, as it takes the link out of keyboard navigation. Without this you could tab to the link, but the screenreader wouldn't be able to explain what just happened because you are in an aria-hidden element that it wants to skip.
The text was updated successfully, but these errors were encountered:
anchor-has-content
That makes sense for this:
But if you are doing a purely presentational image with clickable zones and want screen readers to skip the section entirely, you can add
role="presentation"
andaria-hidden
:In this context, there is no need to add additional text inside the link, so the linter should pass.
Current workaround:
This is pointless though, as the text exists for screen readers, but the screen reader will not ever see it.
Also the
tabindex="-1"
is important, as it takes the link out of keyboard navigation. Without this you could tab to the link, but the screenreader wouldn't be able to explain what just happened because you are in anaria-hidden
element that it wants to skip.The text was updated successfully, but these errors were encountered: