target
`target` chooses where a link opens; `rel` describes the relation to the linked page.
Syntax
<a href="url" target="_blank" rel="noopener">…</a>Parameters
| Parameter | Type | Description |
|---|---|---|
| target | _self | _blank | frame name | Where to open the link: the same tab, a new one or a frame. |
| rel | noopener | nofollow | noreferrer | … | The relation between the current page and the linked one. |
Examples
A new tab and a link that passes no ranking to search engines:
<p><a href="https://example.com" target="_blank" rel="noopener">Open in a new tab</a></p>
<p><a href="https://example.com" rel="nofollow">A sponsored link</a></p>Notes
Without noopener the opened page can control the tab that opened it; modern browsers add it for _blank automatically, but writing it explicitly is a good habit. Do not open every link in a new tab: let users decide where to open links.
See also
Related recipes
In the tutorial
- Links — The a tag and the href attribute, absolute and relative addresses, jumps within a page, a new tab, email and phone links.