The link element can be placed only in the document's head section and it is used to define a link to external source.
This element has no content; it only expresses document relationship(s) information.
Depending on the purpose of the link element and the browser rendering it, the element's results might be presented in different ways such as a drop down menu, etc.
Links are also used to inform search engines about variety of things, such as links to different media (i.e. printing version of the page) or a URI to the version of document written in another language.
The most widely used and browser supported usage of the link element is a link to external style sheets file.
Link is an empty element, therefore the closing tag is forbidden.
Syntax:
<link rel="stylesheet" type="text/css" href="URI" />
Attributes:
- id, class (document-wide identifiers)
- lang (language information), dir (text direction)
- title (element title)
- style (inline style information)
- target (target frame information)
- media (header style information)
- type (content type)
- accesskey (access keys)
- href, hreflang, rel, rev (links specific attributes)
- onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup (intrinsic events)
Example
HTML link element:
Comments
No comments have been made yet.
Please login to leave a comment. Login now