|
|
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.
- _blank - the target URL will open in a new window
- _self - the target URL will open in the same frame as it was
clicked
- _parent - the target URL will open in the parent frameset
- _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
|
|
|