Horje
HTML rel Attribute

Definition and Usage

The rel attribute specifies the relationship between the current document and the linked document/resource.


Applies to

The rel attribute can be used on the following elements:

Elements Attribute
<a> rel
<area> rel
<link> rel
<form> rel

Browser Support

The rel attribute has the following browser support for each element:


How to add A link with a rel attribute - HTML rel Attribute

Rel attribute has been added with a HTML Link.
index.html
Example: HTML
<!DOCTYPE html>
<html>
<body>

<h1>The a rel attribute</h1>

<p><a rel="nofollow" href="https://horje.com/">Horje.com</a></p>

</body>
</html>

Output should be:

How to add A link with a rel attribute - HTML rel Attribute

How to add An image map, with a clickable area - HTML rel Attribute

Area Example. The area rel attribute. Click on the sun to watch it closer.
index.html
Example: HTML
<!DOCTYPE html>
<html>
<body>

<h1>The area rel attribute</h1>

<p>Click on the sun to watch it closer:</p>

<img src="https://horje.com/avatar.png" width="145" height="126" alt="Planets" usemap="#planetmap">

<map name="planetmap">
  <area shape="rect" coords="0,0,82,126" alt="Sun" href="sun.htm" rel="alternate">
</map>

</body>
</html>

Output should be:

How to add An image map, with a clickable area - HTML rel Attribute

How to add An external stylesheet - HTML rel Attribute

Link Example.
index.html
Example: HTML
<!DOCTYPE html>
<html>
<head>
  <link rel="stylesheet" href="styles.css">
</head>
<body>

<h1>Hello World!</h1>

<h2>I am formatted with a linked style sheet.</h2>

<p>Me too!</p>

</body>
</html>

Output should be:

How to add An external stylesheet - HTML rel Attribute




html rel attribute

Type:
Develop
Category:
Web Tutorial
Sub Category:
HTML Attribute
Uploaded by:
Admin


Read Article
https://develop.horje.com/learn/1434/reference