Open In App

HTML link rel Attribute

Last Updated : 26 Mar, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

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:

AttributeDescription
alternateSpecifies an alternative link of the document, such as a print page, translated, or mirror.
authorDefines the author of the link.
dns-prefetchSpecifies that the browser should preemptively perform DNS resolution for the target resource’s origin.
helpSpecifies a link to a help document.
iconSpecifies an import icon in a given document.
licenseSpecifies a link to copyright information for the document.
nextProvides the link to the next document in the series.
pingbackSpecifies the address of the pingback server.
preconnectSpecifies that the target should be preemptively connected to the origin resource.
prefetchSpecifies that the target document should be cached.
preloadSpecifies that the browser must preemptively fetch and cache the resource.
prerenderSpecifies that the browser should load and render the page in the background.
prevSpecifies the previous document in a selection.
searchSpecifies the search tool for the document.
stylesheetImports 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
Previous
Next
Share your thoughts in the comments

Similar Reads