Skip to main content

Links

Designing links that lead to a change in context

Links that open in a new window or tab should indicate that they open in a new window or tab. This is especially helpful for screen reader users to let them know that clicking on the link will open a new window or tab. This helps eliminate confusion caused by changes in context such as opening a web page in a new window or tab.

There are several techniques that we can use when creating links that open in a new window.

<a href="https://moodle.org" target="_blank">
    Moodle.org <i class="fa fa-external-link" role="img" aria-label="Opens in new window" title="Opens in new window"></i>
</a>

The core/userfeedback_footer_link is also good example for this one.

core/userfeedback_footer_link

This may be the most straightforward way of indicating that links open in a new window. The potential downside of this approach is that it can be quite distracting, especially when the page has a lot of links that open in a new window.

<a href="https://moodle.org" target="_blank">
    Moodle.org (Opens in new window)
</a>

A link to a file such as a PDF file or Word document will usually open the relevant application associated to the file type and will cause a change in context. It would be helpful to let users know when a link will open a file.

<a href="https://www.w3.org/WAI/WCAG20/versions/guidelines/wcag20-guidelines-20081211-a4.pdf">
    PDF version of the Web Content Accessibility Guidelines (WCAG) 2.0
</a>

File type indicated via an icon/image’s alt text

<a href="https://www.w3.org/WAI/WCAG20/versions/guidelines/wcag20-guidelines-20081211-a4.pdf">
    Web Content Accessibility Guidelines (WCAG) 2.0 <i class="fa fa-file-pdf-o" role="img" aria-label="PDF document" title="PDF document"></i>
</a>

Similar to links that open in a new window, links that redirect to an external site may also have an indication that they lead to an external site to let users know that clicking on the link will take them away from Moodle.

The example link below opens in the same browser window and lets the user know that they will be redirected to Moodle.org, which is an external site.

<a href="https://moodle.org">
    Moodle.org <i class="fa fa-external-link" role="img" aria-label="Link leads to external site" title="Link leads to external site"></i>
</a>

More information