Links
How to handle links, including links to PDFs
Write good links
Make links active, specific and concise.
Links should describe where they're taking the user. Where you can, use the same words as the title of the page you're linking to. That way, the user will know what to expect.
We do not use link text such as "click here" or anything that does not make sense when read out of context. Screen readers can move between links without reading the surrounding content.
We would use: | We would not use: |
---|---|
Land affected by HS2 | Land affected |
more about the route | more information |
Avoid opening new windows or tabs
Avoid using links or buttons that open new windows or tabs.
There are 2 exceptions to this:
- for instructions or other help with filling in a form (for example, a date picker)
- if a user has logged into a secure site and the link would take them away from it
Read more about opening new windows and tabs only when necessary (on W3C, WCAG2.1).
If links do go to a new tab or window, warn the user by saying: "Link name (opens in new window)". (Include all of this in the link text.)
Avoid linking to PDFs
Wherever possible, we avoid publishing PDFs or linking to them. Read our guidance on PDFs and other non-HTML documents.
We prefer to link to an HTML page containing the PDF. That way, if the PDF is changed or updated, users can still find the latest information.
If we need to link to a PDF, we:
- open it in the same tab
- add "PDF only, [file size in MB or KB]" in brackets to the end of the link text, for example: "weight loss progress chart (PDF only, 545KB)"
Round up values over 1MB to 2 decimal places to keep it as accurate as possible.
Round up values under 1MB to the nearest KB. For example, round up 835.74KB to 836KB.