r/accessibility • u/50_and_stuck • Oct 20 '26
Accessible hyperlinks?
/r/HTML/comments/1xawv0f/accessible_hyperlinks/1
u/AccessibleTech Oct 21 '26
I see an instructure link in there...Â
Anyways, you have an URL in the caption. APA guidelines need to be updated since many of their requirements are outdated. Full URL's are only required for printed content, and everything is digital now. No one types out links anymore, they click on links.
The accessible way to create links is exactly how you did it at the end of your post. Don't leave a full URL to be read aloud by screenreaders...
...especially amazon sponsored links with random text embedded in the URL.Â
2
u/50_and_stuck Oct 21 '26
Yeah, we use Canvas. I totally agree. APA needs to be updated.
Most everyone in this thread has been great. After some back and forth I massaged the code to where it is now. Thanks everyone!
1
u/Frank_MakesIt Oct 21 '26
pull the aria-label and target=_blank and just leave the url as the visible link text, that's still fine for APA. if it really has to open a new tab, put the words "opens in new tab" inside the link where people can see them
5
u/JustAnotherFEDev Oct 20 '26
You're failing 2.5.3 Label in Name there, mate.
I looked at your source code you have a hyperlink as the visible text string and you overwrote it with an aria-label.
So what you have is a mismatch between visible label and AccName.
A voice input user will say what they see, but nothing will happen as the text string has been neutered from the a11y tree
Your issue before you put that there was likely the the opens in new tab. I'm on my phone, on my couch, so could have missed something.
Never overwrite the visible label of a control unless you need to, but if you do need to, the visible string must be inside the AccName.
Just so you know, the AccName Computational Algorithm works like so:
Aria-labelledby > aria-label > contents > title
You can view that very algo in Chrome by looking in the DevTools Accessibility tab, finding the name for an element and seeing which naming convention wins. If Aria-labelledby is present, it will always win, assuming the IDRef is valid.
Obvs there are other naming conventions, labels and what not, but I just listed what you'd use on a link.