Dofactory.com
Dofactory.com
Earn income with your HTML skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest freelancing marketplace for people like you.
By adding your name & email you agree to our terms, privacy and cookie policies.

HTML <link> rel Attribute

The rel attribute on a <link> element defines the relationship between the current page and the linked resource.

Possible values include: stylesheet, icons, author and others.

Multiple relationships can be defined by space-separating the values.

Example

#

A <link> tag with a rel attribute.
The link is to a stylesheet that is used to style the paragraph.

Styled with CSS from the stylesheet.

<link rel="stylesheet" href="/tutorial/style.css">

<p class="aliceblue">Styled with CSS from the stylesheet.</p>

Using rel

The rel attribute defines the relationship between the current page and the linked resource.

Multiple relationshipsL can be defined by separating values with a space.

The rel attribute requires that href has a value.


Syntax

<tagname rel="stylesheet | icons | canonical | 
              dns-prefetch | author | help | license | 
              prev | next | search | alternate" />

Values

#

Value Description
stylesheet Specifies that the link is a stylesheet that will added to the page.
icon Specifies that the link is an icon (favicon or otherwise) that represents page.
canonical Specifies the preferred URL for the current page.
dns-prefetch Specifies to perform pre-emptive DNS resolution for the external resource.
author Specifies the link it to a page about the current page's author.
help Specifies the link is to a help page.
license Specifies the link is to a page with licensing information.
prev Specifies the previous page in a series of pages.
next Specifies the next page in a series of pages.
search Specifies the link is to a search page for the current page.
alternate Specifies the link is to an alternative version of the page. For example, a different device type, or other language version.

Browser support

Here is when rel support started for each browser:

Chrome
1.0 Sep 2008
Firefox
1.0 Sep 2002
IE/Edge
1.0 Aug 1995
Opera
1.0 Jan 2006
Safari
1.0 Jan 2003

You may also like

 Back to <link>

Last updated on Sep 30, 2023

Earn income with your HTML skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest freelancing marketplace for people like you.
By adding your name & email you agree to our terms, privacy and cookie policies.

Guides