Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nu Html Checker - Warning: Possible misuse of aria-label #1687

Open
dave-d1 opened this issue Feb 7, 2024 · 1 comment
Open

Nu Html Checker - Warning: Possible misuse of aria-label #1687

dave-d1 opened this issue Feb 7, 2024 · 1 comment

Comments

@dave-d1
Copy link

dave-d1 commented Feb 7, 2024

I was checking webpage using Nu Html Checker - https://validator.w3.org/nu/ and got these warnings.

Not sure why this would trigger a warning since the aria-label describes the link on these two examples. Thanks.

Warning: Possible misuse of aria-label. (If you disagree with this warning, file an issue report or send e-mail to www-validator@w3.org.)
HTML
<a href="mailto:info@example.com"><span class="bi bi-envelope" aria-label="Envelope icon - click to email"></span></a>

Warning: Possible misuse of aria-label. (If you disagree with this warning, file an issue report or send e-mail to www-validator@w3.org.)
HTML
<a href="tel:+1-713-555-1212"><span class="bi bi-phone" aria-label="Phone icon - click to call 1-713-555-1212"></span></a>

@scottaohara
Copy link
Contributor

aria-label is not allowed on generic elements, per your examples the spans.

looks like you're using font icons. you could just put an aria-label on the hyperlink itself. something simple like "email" and "call". you don't really need to tell people they're icons. nor do you need to tell people to "click" (these are hyperlinks after all - people know how to use them). if the phone number isn't part of the visible text, then you don't need to include that either (why only let screen reader users know what number they're calling and not everyone?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants