HTML5 link tag, Introduction and Use of <link> tag in HTML5.


 

HTML5 link tag, Introduction and Use of <link> tag in HTML5.

In this section, you will see the use of <link> tag in HTML5.

In this section, you will see the use of <link> tag in HTML5.

HTML5 link tag, Introduction and Use of <link> tag in HTML5.

Introduction and Use: :

The <link> tag is used for adding external document in this document, and it specifies the relationship from external document. It can be use inside head document of html page. With the help of href attribute, we assign address of external document for link tag. If href is not present in link tag, then the element does not define a link.
You can use number of link tag. Each link works separately. It separates website design and code.

Attributes of form:
Attribute Value Description
href URL Address of external document .
rel  alternate
archives
author
first
help
icon
index
last
license
next
pingback
prefetch
prev
search
stylesheet
sidebar
tag
up
Define the relationship between current document and external document.
media all
aural
braille
handheld
print
projection
screen
tty
tv
Define media on which document can display.
hreflang two-character ISO code of language. Define the language of external document
type text/css
text/asp
text/plain
text/JavaScript
text/scriptlet
text/vbscript etc
Define the MIME type of external document.
sizes number Specifies the size of external document if it is a icon.

Declaration Syntax :
Declaration syntax of <link> in HTML5.
<link attributes />

Example of <link> in HTML5:

Code:
LiTag.html
<!DOCTYPE html>
<html >
<head>
<title>Example of link tag</title>
<link href="extranal.css" type="text/css" rel="stylesheet" >
<link href="RoseIndia.css" type="text/css" rel="stylesheet">
</head>
<body>
<p>Example of link tag.</p>
<div class="Roseindia" style="height: 78px; width: 269px" ></div>
<font class="bharat">Bharat Singh</font>
</body>
</html>
Output:

Download this code

Difference Between HTML5 and HTML4.01:

No difference.

Ads