target="_self"
Default behavior: open in the current browsing context.
Learn Link Targets with practical HTML examples for navigation, images, alt text, media behavior, metadata, accessibility, SEO and live practice.
HTML links and media
The target attribute controls where a linked page opens. The most common value is _blank, which opens a new tab or window.
Opening new tabs can be useful for external resources, documents or references, but it should not be the default for every link. Users often expect normal navigation unless there is a clear reason.
Whenever you use target="_blank", also use rel="noopener" to protect the original page from the new page.
Default behavior: open in the current browsing context.
Open in a new tab or window.
Prevents the new page from controlling the original page.
Hints that the linked resource should be downloaded.
Syntax and structure
The target attribute changes behavior. The rel attribute explains the relationship and can improve security.
<a href="https://developer.mozilla.org/" target="_blank" rel="noopener" > Open MDN Web Docs </a> <a href="/downloads/html-checklist.pdf" download> Download the HTML checklist </a>
<a href="https://example.com" target="_blank">External site</a> <a href="/about.php" target="_blank">About us</a> <a href="file.pdf">click</a>
Rules that matter
Clickable and visual HTML affects how people move, scan, trust and share a page. The details are small, but the user experience impact is large.
Open a new tab only when it helps the user keep the current page.
Use rel="noopener" on target="_blank" links.
If a link downloads a file, say what the file is.
Most internal links should open in the same tab.
Unexpected new tabs can feel messy, especially on mobile.
noreferrer also hides referrer data, which may affect analytics.
Production thinking
This matters because a link is a promise. If it opens somewhere unexpected or creates a security issue, the page feels less professional.
If a link opens a new tab or downloads a file, clear link text helps users understand the behavior before activating it.
Audit external links. New-tab behavior, rel values and downloadable files should be consistent across the site.
Target does not make a link stronger for SEO. Clear internal linking and natural anchor text matter more.
Live code lab
Edit the HTML or CSS, then use Run to refresh the preview. The preview is isolated, so links and forms stay inside this practice area.
Mini assignment
Practice assignment
Try it yourself
Self-check
Do not only read this page. Answer these questions out loud or write the answers in your own notes. If one answer feels vague, revisit the examples before moving on.