Tutorials Point


  HTML Home

  HTML Tags Reference
  Selected Reading

Copyright © 2014 by tutorialspoint



  Home     References     Discussion Forums     About TP  

HTML <link> tag




Advertisements

Function:

The HTML <link> tag is used for defining a link to an external document. It is placed in the <head> section of the document.

Difference between HTML and XHTML:

In HTML the <link> tag has no end tag.

In XHTML the <link> tag must be properly closed.

Example:

<link rel="stylesheet" type="text/css" href="/style.css" />

Attributes:

AttributeValueDescription
charsetcharsetDefines the character encoding of the linked document.
hrefURLSpecifies the URL of the resource document.
hreflanglanguageLanguage code of the destination URL
typemimetypeThe MIMEtype of content at the link destination
relalternate
appendix
bookmark
chapter
contents
copyright
glossary
help
home
index
next
prev
section
start
stylesheet
subsection
Describes the relationship between the current document and the destination URL.
revalternate
appendix
bookmark
chapter
contents
copyright
glossary
help
home
index
next
prev
section
start
stylesheet
subsection
Describes a reverse between the destination URI and the current document.
targetblank
_self
_top
_parent
Specifies the target frame to load the page into.
mediascreen
tty
tv
projection
handheld
print
braille
aural
all
Specifies the device the document will be displayed on

Standard Attributes:

AttributeDescription
classDocument wide identifier
dirSpecifies the direction of the text
idDocument wide identifier
titleSpecifies a title to associate with the element.
styleHelps to include inline casecadubf style sheet.
langSets the language code.
xml:langSets the language code.

Event Attributes:

AttributeDescription
onclickScript runs when a mouse click
ondblclickScript runs when a mouse double-click
onmousedownScript runs when mouse button is pressed
onmouseupScript runs when mouse button is released
onmouseoverScript runs when mouse pointer moves over an element
onmousemoveScript runs when mouse pointer moves
onmouseoutScript runs when mouse pointer moves out of an element
onkeypressScript runs when key is pressed and released
onkeydownScript runs when key is pressed
onkeyupScript runs when key is released

Printer Friendly

Advertisements


  

Advertisements