HTML link rel Attribute
Last Updated :
26 Mar, 2024
The HTMLÂ <link>
 rel attribute is a key component in defining the relationship between the current document and the linked document or resource. It is used only when the href attribute is present.
Syntax:Â Â
<link rel="value">
Attribute Values:
Attribute | Description |
---|
alternate | Specifies an alternative link of the document, such as a print page, translated, or mirror. |
author | Defines the author of the link. |
dns-prefetch | Specifies that the browser should preemptively perform DNS resolution for the target resource’s origin. |
help | Specifies a link to a help document. |
icon | Specifies an import icon in a given document. |
license | Specifies a link to copyright information for the document. |
next | Provides the link to the next document in the series. |
pingback | Specifies the address of the pingback server. |
preconnect | Specifies that the target should be preemptively connected to the origin resource. |
prefetch | Specifies that the target document should be cached. |
preload | Specifies that the browser must preemptively fetch and cache the resource. |
prerender | Specifies that the browser should load and render the page in the background. |
prev | Specifies the previous document in a selection. |
search | Specifies the search tool for the document. |
stylesheet | Imports a style sheet. |
Example of HTML link rel Attribute
Example 1: In this example, we are showing the example of link rel attribute in html.
html
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet"
type="text/css"
href="index_screen.css">
<link rel="stylesheet"
type="text/css"
href="index_print.css">
</head>
<body>
<center>
<h1>GeeksforGeeks</h1>
<p><a href="https://ide.geeksforgeeks.org/tryit.php"
target="_blank">
Click here
</a>
</center>
</body>
</html>
Output:Â
By understanding and effectively using the HTML <link> rel attribute, you can enhance the user experience on your webpages by defining the relationship between the current and the linked document.
Supported Browsers: The browsers supported by HTML rel Attribute are listed belowÂ
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...