Skip to content

HTML Tutorial Links

HTML Link Targets: Opening Links in a New Tab and Using rel

Lesson 19 of 81 2 min read By Deepak Paswan Updated Oct 4, 2026

By default a link opens in the same tab. The target attribute changes that.

ValueWhere the link opens
_selfThe same tab (default)
_blankA new tab or window
index.html
HTML
<a href="https://example.com" target="_blank" rel="noopener noreferrer">Open the example in a new tab</a>

Always add rel with _blank

rel describes the relationship between your page and the link. For target="_blank" add rel="noopener noreferrer". It stops the new page from being able to control your page and keeps your address from being passed on. Modern browsers already protect against the first problem, but adding it is still good practice and harmless.

Other useful rel values

ValueUse
nofollowTell search engines you do not endorse the link
sponsoredThe link is paid or an advertisement
ugcThe link was added by users, for example in comments

When to open a new tab

New tabs can be annoying. Visitors can open one themselves when they want it. A new tab is reasonable when leaving the page would lose something, such as a half-filled form. If you open new tabs, say so in the link text, for example “(opens in a new tab)”.

warning
Opening every link in a new tab
It breaks the Back button and can confuse people who use screen readers. Keep internal links in the same tab.