HTML <link> rel Attribute
Example
An external stylesheet:
<link rel="stylesheet" type="text/css" href="theme.css">
Try it Yourself »
Definition and Usage
The required rel attribute specifies the relationship between the current document and the linked document/resource.
Browser Support
Attribute | |||||
---|---|---|---|---|---|
rel | Yes | Yes | Yes | Yes | Yes |
Differences Between HTML 4.01 and HTML5
Some HTML 4.01 values are removed from HTML5, and some new values are added to HTML5.
Syntax
<link rel="value">
Attribute Values
Value | Description |
---|---|
alternate | Provides a link to an alternate version of the document (i.e. print page, translated or mirror). Example: <link rel="alternate" type="application/atom+xml" title="W3Schools News" href="/blog/news/atom"> |
author | Provides a link to the author of the document |
dns-prefetch | Specifies that the browser should preemptively perform DNS resolution for the target resource's origin |
help | Provides a link to a help document. Example: <link rel="help" href="/help/"> |
icon | Imports an icon to represent the document. Example: <link rel="icon" href="/favicon.ico" type="image/x-icon"> |
license | Provides a link to copyright information for the document |
next | Provides a link to the next document in the series |
pingback | Provides the address of the pingback server that handles pingbacks to the current document |
preconnect | Specifies that the browser should preemptively connect to the target resource's origin. |
prefetch | Specifies that the browser should preemptively fetch and cache the target resource as it is likely to be required for a follow-up navigation |
preload | Specifies that the browser agent must preemptively fetch and cache the target resource for current navigation according to the destination given by the "as" attribute (and the priority associated with that destination). |
prev | Indicates that the document is a part of a series, and that the previous document in the series is the referenced document |
search | Provides a link to a resource that can be used to search through the current document and its related pages. |
stylesheet | Imports a style sheet |
❮ HTML <link> tag