Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / HTML

rel — relationship between a document and a resource

The rel attribute specifies a resource relationship or how a link is processed. It accepts whitespace-separated keywords whose meaning and permitted use depend on the element.

Version: WHATWG HTML Living Standard; index snapshot date recorded separately

Syntax

rel="keyword1 keyword2"

rel appears on a, area, link, and form; it is not a global attribute. Its value is an unordered set of unique tokens separated by ASCII whitespace, not commas. Keywords are ASCII case-insensitive.

Permitted keywords depend on the element. On link, stylesheet identifies an external style sheet, while next identifies the next document in a series. Without recognized, permitted keywords, link creates no links. In contrast, a and area with href still create ordinary hyperlinks without rel.

For hyperlinks, noopener disconnects a newly opened window from window.opener; noreferrer additionally suppresses referrer information and implies noopener. nofollow signals lack of endorsement or a commercial relationship—it does not prevent navigation or replace these protections.

The example combines help and nofollow. The relList property lets you check individual tokens without splitting the attribute text.

Examples

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>rel demo</title>
</head>
<body>
  <a id="reference" href="#details" rel="help nofollow">Details</a>
  <p id="details">Additional information.</p>
  <pre id="result"></pre>
  <script>
    const anchor = document.getElementById('reference');
    document.getElementById('result').textContent =
      anchor.relList.contains('help') + '\n' +
      anchor.relList.contains('nofollow');
  </script>
</body>
</html>

Result

true
true

The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.

Sources