Links

The different link types that can appear on the site — internal, external, email, phone, download — each with its correct markup.

Internal link

Leads to another page on the same site.

Home

<a href="/en">

External link

Leads to another domain and opens in a new tab.

sap.com

target="_blank" rel="noopener noreferrer"

Anchor link

Scrolls to a section on the same page.

Best practices

<a href="#best-practices">

Email link

Opens the default mail client with a pre-filled address.

info@spectrumconsulting.ch

<a href="mailto:...">

Phone link

Starts a call directly on mobile devices.

+41 44 311 67 01

<a href="tel:...">

Download link

Downloads a file instead of opening it in the browser.

Broschüre.pdf

<a href="..." download>

Disabled link

Represents an action that is currently unavailable — no real href.

Internal link

<span aria-disabled="true">

Best practices

Link or button?

A link navigates to a URL (another page, an anchor, a file, a mail client). If an element triggers an action instead (submit a form, open a modal, change some state), it should be marked up as a <button> — not as <a href="#"> or <a href="javascript:void(0)">.

rel="noopener noreferrer" with target="_blank"

A link that opens in a new tab should carry rel="noopener noreferrer". Without noopener, the opened page gets access to the original window via window.opener — a security risk. A visual cue (icon) should also signal that a new tab will open.

Marking up disabled links correctly

An <a> without an href attribute is not keyboard-focusable and behaves inconsistently for screen reader users. For an action that is temporarily unavailable, a <span aria-disabled="true"> or a real <button disabled> is more appropriate, depending on whether it is really navigation or an action.

Descriptive link text

Link text should be understandable on its own ("Download the price list" rather than "click here"), since screen reader users often browse a list of all links on the page, detached from their surrounding text.