Home Tutorial Html Html5 Rel attribute in anchor tag, Use of rel attribute in anchor tag.

 
 

Rel attribute in anchor tag, Use of rel attribute in anchor tag.
Posted on: September 2, 2010 at 12:00 AM
Advertisement
Discuss the use of rel(relationship) attribute of anchor tag in HTML5.

Rel attribute in anchor tag, Use of rel attribute in anchor tag.

Description:

You will see the use of rel attribute of anchor tag and how to implement. The rel (relationship) attribute defines the relationship between current page and target document.
Relationship is a way to explain why we are pointing to another page or document    .

Rel Attribute :
Attribute Value Description
  alternate Indicates alternative version of link document.
rel archives Indicates that linked document describes a collection of historical data or document.
  author Information about the author of the linked document.
  bookmark provides a permanent link to a document.
  external indicates that the linked document is not a part of the current site.
  feed Links to a feed channel for the document or the web site.
  first Indicates that linked document is first page of a series.
  help Indicates that linked document is help document
  index Indicates that linked document is index document.
  last Indicates that linked document is last page of a series.
license Links to a document that describes the license information of current document.
  next Links to a next document in a series.
  nofollow Indicates that the link is not justified by the author of the document.
  noreferrer Indicates that the browser should not send a HTTP referrer header if the user follows this link.
  prev Indicates that linked document is previous page of a series.
  search Indicates that the linked document provides an interface for searching the document.
  sidebar Indicates that the linked document should be display in current browser's sidebar.
  tag Indicates that the tag present on links document applies on the current document.
  up  Links to a higher level document in the hierarchy.


Declaration Syntax :

Declaration syntax of rel attribute in anchor tag.

                  <a  href="value" rel="value">Text Area</a>

Example of rel attribute:

Code:

hrefAttributeTag.html

<!DOCTYPE html>
<html>
<head>
<title>Write title of document.</title>
</head>
<body>
<p>rel attribute of anchor tag in HTML5.</p>
<a rel="nofllow" href="http://www.google.co.in/" >
Do not follow this link.</a><br>
<a rel="alternate" href="EnglishVersionDoc.html" 
hreflang="en">
English version of document</a><br>
<a rel="next" href="PreviousDoc.html">
Open previous document</a><br>
<a rel="prev" href="nextDoc.html">
Open next document</a><br>
</body> 
</html>
Output:

Note: See the browser compatible page for successfully rendering the program.

Download this code

Advertisement

Related Tags for Rel attribute in anchor tag, Use of rel attribute in anchor tag.:


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: September 2, 2010

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com