HTML target="_blank" and rel
- type
- attributes, on <a>
- applies to
- a link that should open somewhere new
- lives inside
- the opening <a> tag
- common values
- target="_blank" rel="noopener"
Where it goes
Both go on the <a> tag, next to href: <a href="..." target="_blank" rel="noopener">.
Example
<a href="https://example.com" target="_blank" rel="noopener">Visit</a>Open this example in the editor →
Common mistakes
- Adding target="_blank" without rel="noopener". The link works and looks fine, so the gap is easy to ship without noticing.
- Thinking rel="noopener" is only for links to sites you do not trust. Use it on every target="_blank" link.