- Not be be confused with
<a/>, the element that creates hyperlinks.
The void HTML <link /> element defines the relationship between a document and an external resource. It is typically used to link to external style sheets. This element can only be inserted within the <head> section, but it can appear any number of times. It can also be used to link to your Favicon or external stylesheet.
Attributes
| Attribute | Value | Description |
|---|---|---|
| charset | char_encoding | Deprecated |
| href | URL | The target URL of the resource. |
| hreflang | language_code | Defines the base language of the target URL. |
| media | screen tty tv projection handheld braille aural all |
Specifies on what device the document will be displayed. |
| rel | alternate archives author first help icon index last license next pingback prefetch prev search stylesheet sidebar tag up |
Specifies the relationship between the current document and the target URL. Use only if the href attribute is present.
|
| rev | reversed relationship | Deprecated: |
| sizes | number any |
Defines sizes of the linked resource. Can be used when rel="icon".
|
| target | _blank _self _top _parent frame_name |
Deprecated |
| type | MIME_type like: text/css text/javascript image/gif |
Specifies the MIME type of the target URL. |
HTML example:
<head> <link rel="stylesheet" type="text/css" href="MyCSS.css" /> <link rel="icon" href="Favicon.ico" /> </head>