Your daily frequent11y newsletter, brought to you by @ChrisBAshton:
- Rian Rietveld tackles all the common questions around links:
- It is usually better to stick with the browser default behaviour, i.e. don’t open links in new tabs/windows. However, it’s OK to do so if you make it clear (“Opens in new window” in the text of the link).
- Link text should be meaningful and understandable on its own. “Click here” is about the worst link text there is. Proper link text is much easier to scan.
- For emails, use
mailto:someone@example.com
as yourhref
. For telephone numbers, usetel:+31108429259
; these will open emails in email clients and make phone calls respectively. For the link text, it’s a good idea to repeat the email and phone numbers, rather than using “email” and “call us”. - For linking to files such as PDFs, but the filetype and size in brackets, e.g. “Web Accessibility Principles (PDF, 327 Kb)”.
- When embedding images in a link, use alt text that makes sense as link text, e.g. “Wikipedia page on cherry blossoms” rather than “A cherry tree in full bloom”, as the image
alt
text will get read out by screen readers as part of the link. - Links in the body should generally be underlined – relying on colour difference alone isn’t distinguishable for colour-blind or visually impaired users. Links in navigation need not be underlined, as these are more obviously links.
- As always, ensure your links have hover and focus styles. Rian recommends not removing the browser’s default outline.
- For internal links, your
href
attribute should point to an ID – not to another link with aname
attribute, which has been obsolete since HTML5.
Prefer longer newsletters? You can subscribe to week11y, fortnight11y or even month11y updates! Every newsletter gets the same content; it is your choice to have short, regular emails or longer, less frequent ones. Curated with ♥ by developer @ChrisBAshton.