HTMLforall

  HTML | PHP | Forum

HTML <link> tag

Syntax

<link>

Definition and Usage

The LINK element defines document relationships. Any number of LINK elements may be contained in the HEAD of a document. Many browsers lack support for LINK, so authors should not depend on the browser making the links available to the user.

Optional Attributes

Attribute Value Description
charset charset Defines the character encoding of the target URL. Default value is "ISO-8859-1"
href URL The target URL of the resource
hreflang language_code Defines the base language of the target URL
media all
braille
print
projection
screen
speech
Specifies on what device the document will be displayed
rel alternate
appendix
bookmark
chapter
contents
copyright
glossary
help
home
index
next
prev
section
start
stylesheet
subsection
Defines the relationship between the current document and the targeted document
rev alternate
appendix
bookmark
chapter
contents
copyright
glossary
help
home
index
next
prev
section
start
stylesheet
subsection
Defines the relationship between the targeted document and the current document
target _blank
_self
_top
_parent
Where to open the target URL.
  1. _blank - the target URL will open in a new window
  2. _self - the target URL will open in the same frame as it was clicked
  3. _parent - the target URL will open in the parent frameset
  4. _top - the target URL will open in the full body of the window
type MIME_type like:
text/css
text/javascript
image/gif
Specifies the MIME type of the target URL

Standard Attributes

id, class, title, style, dir, lang, xml:lang

For a full description, go to Standard Attributes.

Event Attributes

onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup

For a full description, go to Event Attributes.

Example

Source Output
Link to an icon (inside the head element)

<head>
<link href="http://www.htmlforall.com/images/htmlico.ico" rel="shortcut icon" />
</head>

NA

Home

Learn HTML
HTML Tutorial

HTML Reference
HTML by function
HTML by Alphabet

HTML events
HTML attributes
HTML color names

Top-Level Elements
<!--...-->
<!DOCTYPE> 
<html>
<head>
<body>
<frameset>
Head Elements
<base>
<isindex>
<link>
<meta>
<script>
<style>
<title>
Generic Block-level Elements
<address>
<blockquote>
<center>
<del>
<div>
<h1> to <h6>
<hr>
<ins>
<isindex>
<noscript>
<p>
<pre>
Lists
<dd>
<dir>
<dl>
<dt>
<li>
<menu>
<ol>
<ul>
Tables
<caption>
<col>
<colgroup>
<table>
<tbody>
<td>
<tfoot>
<th>
<thead>
<tr>
Forms
<button>
<fieldset>
<form>
<input>
<label>
<legend>
<option>
<optgroup>
<select>
<textarea>
Special Inline Elements
<a>
<applet>
<area>
<basefont>
<bdo>
<br>
<font>
<iframe>
<img>
<map>
<object>
<param>
<q>
<script>
<span>
<sub>
<sup>
Phrase Elements
<abbr>
<acronym>
<cite>
<code>
<del>
<dfn>
<em>
<ins>
<kbd>
<samp>
<strong>
<var>
Font Style Elements
<b>
<big>
<i>
<s>
<small>
<strike>
<tt>
<u>
Frames
<frame>
<frameset>
<noframes>

 

Copyright 2005-8 Sunilcare.  All Rights Reserved.
Comments or suggestions? Contact us.About us