HTML Link Titles & Targets
The Links session gave you working a elements with clear href values. Two common extras change the experience without replacing href: a title attribute for a short hover hint, and a target that can open the destination in a new browser tab. Used carefully, they help. Used on every menu item, they annoy people and create safety footguns.
What these attributes do
href still decides where the link goes. title, target, and rel adjust hints and how the browser opens that destination. Learn them as optional tools on top of solid link text — not as substitutes for descriptive wording.
Direct answer
title="…"— optional advisory tooltip text on hover (support and usefulness vary; never rely on it alone)target="_blank"— open in a new tab or window- With
_blank, also setrel="noopener noreferrer"so the new page cannot take full control of your original tab throughwindow.opener(safer everyday pattern)
Keep in-site navigation in the same tab by default. Reserve_blankfor cases where staying on your page truly helps — often external references or downloads.
title, target, and rel at a glance
📊 Link extras compared
| Attribute | Job |
|---|---|
| title | Short hover hint (extra context) |
| target | Where the destination opens (_blank = new tab/window) |
| rel | Relationship tokens; with _blank use noopener noreferrer |
| href | Still the destination URL (unchanged) |
A helpful title tooltip
Use title when a short extra hint adds value beyond the visible link text. Do not paste the exact same sentence into both places hoping that doubles clarity — screen reader and hover experiences differ, and empty repetition wastes attention.
Link with title tooltip
html<a href="guide.html" title="Opens the beginner guide">Beginner guide</a>
Reading the title sample
- Visible text
Beginner guideremains the primary label titleadds a brief advisory string on hover in many desktop browsers- Mobile and assistive tech may not expose
titlethe same way — keep the visible text strong hrefstill points toguide.html; title does not navigate by itself
New tab with a safer rel
Opening an external site in a new tab can let readers keep your lesson open. Pair _blank with rel="noopener noreferrer" as the default safer habit for those cases.
New tab with safer rel
html<a href="https://www.example.com" target="_blank" rel="noopener noreferrer">
Example (new tab)
</a>
Why noopener and noreferrer
noopenerreduces the risk that the new page manipulates your original tab viawindow.openernoreferreralso avoids sending a referrer in many browsers (privacy side effect; still commonly taught with this pattern)
You do not need deep browser-security theory in this course — memorize the paired attributes for_blankexternal links and move on.
Do not blank everything
New tabs multiply. If every sidebar link opens _blank, users lose the simple Back button story and end up with a pile of tabs. Prefer same-tab links for your own pages (about.html, next lesson, home). Use _blank when leaving your site or when the product requirement clearly asks for it.
title is not the page title
The document <title> in head labels the whole tab. The title attribute on an a is only a hint on that link. Different jobs, similar English word — do not confuse them.
Practice in your editor
- Add a local link with clear visible text and a helpful
titlethat adds one extra detail. - Add an external link with
target="_blank"andrel="noopener noreferrer". - Hover (on desktop) to see the tooltip; click to confirm a new tab.
- Keep a third in-site link without
_blankand confirm it replaces the current tab normally. - Rewrite any
titlethat merely repeats the link text with zero new information.
Easy mistakes
- Using
_blankon every internal menu item - Forgetting
rel="noopener noreferrer"on_blankexternal links - Writing a useless
titlethat only echoes the link text - Thinking
titleortargetcan replace a missinghref - Confusing the link
titleattribute with the document<title>element
Summary
titlecan add a short hover hint; visible link text stays primarytarget="_blank"opens a new tab or window- Pair
_blankwithrel="noopener noreferrer"for safer external links - Prefer same-tab navigation for your own pages
hrefremains the destination; these attributes only refine the experience
🧠 Test Your Knowledge
Test Your Knowledge
Challenge yourself with this interactive quiz and see how well you understand the topic
📝 Instructions
- Read each question carefully
- Select the best answer for each question
- You can retake the quiz as many times as you want
- Your progress will be shown at the top