The 'HT' in HTML stands for HyperText — and links are what make it 'hyper'. A link, or anchor, is what turns a pile of pages into a connected web. It is one of the most important elements you will ever write.
1The anchor element
A link is an <a> element with an href attribute pointing to a destination. The text between the tags is what the user clicks:
<a href="https://vidaara.org">Visit Vidaara</a>
There are two kinds of destination:
- Absolute — a full address starting with
https://. Use it to link to other websites. - Relative — a path on your own site, like
/aboutorcontact.html. Use it to link between your own pages.
- A link is
<a href="…">text</a>. - Absolute URLs (
https://…) link to other sites; relative paths (/about) link within your own. - Write descriptive link text — never "click here".
2New tabs, jumps and email links
A few common variations you will reach for often:
Open in a new tab — safely
Add target="_blank" to open a link in a new tab. When you do, always add rel="noopener noreferrer" too — it closes a small security and performance hole:
<a href="https://example.com" target="_blank" rel="noopener noreferrer">External site</a>
Jump to a section on the same page
If an element has an id, you can link to it with # plus that id — handy for a table of contents: <a href="#faq">Jump to FAQ</a> jumps to <section id="faq">.
Email and phone links
<a href="mailto:hi@vidaara.org">Email us</a> opens the visitor's email app; tel: works the same for phone numbers on mobiles.
target="_blank"opens a new tab — always pair it withrel="noopener noreferrer".- Link to a section with
href="#id"matching an element'sid. mailto:andtel:links open the email or phone app.
★ Practical: a tiny link hub
In any playground, create a short page with:
- A link to an external website (absolute URL) that opens in a new tab safely.
- A relative link to a made-up page on your own site, e.g.
/about. - An email link using
mailto:. - Make sure each link's text describes where it goes.
Ready to test yourself?
Take the short quiz. Score 60% or more to mark this lesson complete.
Start the quiz →💡 Log in to save your progress and earn the certificate.