HTML Link Tag
Reference on the HTML Link Tag. Including its useful example, and a list of the allowed attributes.
The Link element of HTML is used to link external files with a document.
Its most common use, is perhaps, to link external CSS StyleSheets. But it can also be used to link to different translations of a document.
Attributes
| Attribute: | Value: | Description: |
| Attrs | Other Attributes | Common, I18n, Event |
| Charset | Character encoding | Character encoding of resource |
| href | URI | URI for linked resource |
| hreflang | Language Code | language of resource, if href is used. |
| type | Media Type | The Content Type of the resource. |
| rel | Link Types | Space-separated list of forward links |
| rev | Link Types | Space-separated list of reverse links |
| media | Media Descriptor | Either a single, or comma-separated list. I.e. "screen,print" |
Example
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>Using the HTML Link Tag</title>
<link rel="stylesheet" type="text/css" href="StyleSheet.css">
</head>
<body>
<p>How to add a Stylesheet using Link</p>
</body>
</html>