How do you create hyperlinks in HTML?
Hyperlinks use the anchor element <a>, whose href attribute holds the destination and whose content is the clickable text the user sees.
The anchor (<a>) is what makes HTML "hyper" — it turns text into a link to another resource:
<a href="destination">Link Text</a>
The two parts are the href ("hypertext reference"), which is the URL to go to, and the text between the tags, which is what appears on screen and responds to a click:
<a href="https://www.hslu.ch">Visit HSLU</a>
An optional target attribute controls where the link opens:
| Value | Behavior |
|---|---|
_self |
Opens in the same tab — this is the default |
_blank |
Opens in a new tab or window |
<a href="https://www.hslu.ch" target="_blank">HSLU (new tab)</a>
Gotcha: opening links in a new tab with _blank is sometimes seen as poor practice for ordinary navigation, because it overrides the user's expectation of how the back button works — reserve it for cases where leaving the current page would interrupt a task.
Go deeper:
<a>: the anchor element — MDN —href,target,rel, plus link-text and security best practices for_blank.