👀 Live Preview
External link opened safely in a new tab:
Open example.comrel="noopener noreferrer" blocks window.opener access and omits the Referer header.

The rel attribute describes the relationship between the current document and a linked resource. On <link> it declares head resources like stylesheet, icon, and canonical. On <a> it controls link behavior — noopener and noreferrer for security, nofollow for SEO hints, prev and next for pagination. You can combine multiple keywords: rel="noopener noreferrer". Set element.rel or use element.relList in JavaScript.
Link type.
Head tags.
Anchors.
Security.
SEO hint.
JS API.
rel AttributeBrowsers, search engines, and assistive tech use rel to understand what a link means — not just where it points. A stylesheet link tells the browser to apply CSS. A canonical link tells crawlers which URL is authoritative. An anchor with noopener tells the browser to isolate a new tab from window.opener attacks.
Using the correct rel value makes documents more semantic, safer, and easier for search engines to interpret.
Use a space-separated list: rel="noopener noreferrer". Each keyword adds a separate relationship.
Add rel with one or more relationship keywords:
<!-- link in head -->
<link rel="stylesheet" href="/styles/main.css">
<link rel="icon" href="/favicon.ico">
<!-- anchor -->
<a href="https://example.com"
target="_blank" rel="noopener noreferrer">External</a><link>: common values include stylesheet, icon, canonical, preload, alternate.<a> and <area>: noopener, noreferrer, nofollow, prev, next, external.rel="noopener" (or noreferrer) with target="_blank".anchor.rel = "nofollow" or anchor.relList.add("noopener").Common rel keywords by element:
<link>stylesheet — External CSS file.icon — Favicon or app icon.canonical — Preferred URL for duplicate content.alternate — Alternate representation (RSS, translated page).preload / preconnect / dns-prefetch — Performance hints.<a>noopener — New tab cannot access window.opener.noreferrer — No Referer header; implies noopener.nofollow — SEO hint: do not pass ranking credit.sponsored / ugc — Paid or user-generated content links.prev / next — Pagination sequence (separate values).<link rel="canonical" href="https://example.com/page">
<a href="/sponsored-post" rel="sponsored nofollow">Ad</a>| Value | Element | Purpose |
|---|---|---|
stylesheet | link | Load CSS |
icon | link | Favicon |
canonical | link | SEO preferred URL |
noopener | a | Block tab-nabbing |
noreferrer | a | No Referer + noopener |
nofollow | a | SEO crawl hint |
| Element | Supported? | Common rel values |
|---|---|---|
<link> | Yes | stylesheet, icon, canonical, preload |
<a> | Yes | noopener, noreferrer, nofollow, prev, next |
<area> | Yes | Same as a (image maps) |
<form> | Yes | nofollow, noreferrer, etc. |
<img> | No | Use a wrapping image instead |
noopener vs noreferrer vs referrerpolicy| Feature | Blocks opener | Suppresses Referer |
|---|---|---|
rel="noopener" | Yes | No |
rel="noreferrer" | Yes (implied) | Yes |
referrerpolicy="no-referrer" | No | Yes (granular policies) |
rel="nofollow" | No | No (SEO only) |
link rel=stylesheet in the head, dynamic nofollow on an anchor, and secure target="_blank" with noopener noreferrer.
External link opened safely in a new tab:
Open example.comrel="noopener noreferrer" blocks window.opener access and omits the Referer header.
Connect an external CSS file in the document head:
<head>
<link rel="stylesheet" href="/styles/main.css">
<link rel="icon" href="/favicon.ico">
</head>The browser reads rel to decide how to handle the linked resource — as CSS, an icon, or another resource type.
Add nofollow to a link when it points to user-generated content:
<a id="dynamicLink" href="https://example.com">User link</a>
<script>
document.getElementById("dynamicLink").rel = "nofollow";
// or: link.relList.add("nofollow");
</script>Dynamic rel is useful for user-submitted links, comment sections, or CMS content where trust level varies per URL.
Always secure external links that open new tabs:
<a href="https://partner.com"
target="_blank"
rel="noopener noreferrer">
Visit partner site
</a>noopener severs the opener reference. noreferrer also hides the Referer. Modern browsers imply noopener for target="_blank", but explicit rel is still best practice.
rel is for machines and browsers.target="_blank".rel="stylesheet" enables visual design required for readable, accessible layouts.Read keywords.
Per keyword.
With context.
Safe + semantic.
The rel attribute is supported on link and a in all browsers. Individual keywords vary — noopener and stylesheet are universal in modern browsers.
rel attributeCore keywords work everywhere; newer values like sponsored are supported in modern crawlers.
Bottom line: Safe for link relationships in all browsers. Always add noopener to target="_blank" links.
rel="noopener noreferrer" on every target="_blank" linkrel="canonical" on duplicate or parameterized URLssponsored or ugcrel="stylesheet" for external CSS in headrelList.add() when combining multiple keywords in JStarget="_blank" without noopenernofollow blocks crawling entirely — it is a hintrel on link (e.g. stylesheet on an anchor)noreferrer alone for fine-grained Referer control — use referrerpolicyprev/next as one value — they are separate keywordsThe rel attribute tells browsers and crawlers what a link means — from stylesheets and favicons to secure external navigation and SEO hints.
Master the common keywords on link and a, and always pair new-tab links with noopener.
relBookmark these before adding links.
Not just href.
CoreOn link.
CSSTab safety.
SecuritySEO hint.
CrawlSpace-separated.
Syntaxlink (in head) and a (anchors). Also area and form.target="_blank" from accessing window.opener, blocking tab-nabbing attacks.rel="noopener noreferrer". In JavaScript use element.relList.add("noopener").nofollow is a hint to crawlers not to pass ranking credit. It does not prevent discovery or indexing of the target URL entirely.stylesheet and noopener work in all modern browsers and IE 11+.Practice rel on stylesheet links, dynamic nofollow, and secure target="_blank" anchors in the Try It editor.
5 people found this page helpful