Open In App

HTML link rel Attribute

Last Updated : 06 May, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

The <link> rel attribute is an essential part of HTML that specifies the relationship between the current document and a linked document or resource. It is used in conjunction with the href attribute to define how the two documents relate to each other.

Syntax:  

<link rel="value" href="URL">

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 1: In this example, we are showing the example of link rel attribute in html.

index.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://www.geeksforgeeks.org/community/"
        target="_blank"> 
    Click here 
    </a> 
    </center> 
</body> 
</html>

By understanding and effectively using the HTML <link> rel attribute, you can improve user experience on your webpages. It helps define how your current document interacts with others, making it easier for browsers and search engines to understand and index your content.

Supported Browsers: The browsers supported by HTML rel Attribute are listed below 



Next Article

Similar Reads