English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Reference Manual

HTML Tag Directory

HTML link rel attribute

The required rel attribute specifies the current document and the linked document/the relationship between resources.

 HTML <link> tag

Online Example

An external stylesheet:

!DOCTYPE html
<html>
<head>
<meta charset="utf-8">
<title>HTML <link> rel Attribute Usage-Basic Tutorial(oldtoolbag.com)</title>
<link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body
<h1>I am formatted with a linked style sheet</h1>
<p>Me too!/p>
</body>
</html>
Test and see ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

All mainstream browsers support the rel attribute.

Definition and Usage

The rel attribute is required, specifying the relationship between the current document and the linked document/the relationship between resources.

HTML 4.01 with HTML5differences

in HTML5 Removed some HTML 4.01 The value in the syntax has added some new values.

Syntax

<link rel="value">

Attribute value

ValueDescription
alternateLink to the alternative version of the document (such as a print page, translation, or mirror).
authorLink to the author of the document.
helpLink to the help document.
iconImport the icon representing the document.
licenseLink to the copyright information of the document.
nextIndicates that the document is part of a collection, and the next document in the collection is the referenced document.
prefetchSpecifies that the target resource should be cached.
prevIndicates that the document is part of a collection, and the previous document in the collection is the referenced document.
searchLink to the search tool for the document.
stylesheetThe URL of the style sheet to be imported.
 HTML <link> tag