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.
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>
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.
<tagname rel="stylesheet | icons | canonical | dns-prefetch | author | help | license | prev | next | search | alternate" />
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. |
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 |
Back to <link>