<link> element specifies relationships between the current document and an external resource.
It is placed in the <head> section of the document.
This element is most commonly used to link to stylesheets, but is also used to establish site icons (both "favicon" style icons and mobile home screen/app icons) among other things.
This element is an empty element which means that it has no end tag.
<link rel="stylesheet" href="/example.css">
<link> element is fully supported by all browsers:
The following table shows the attributes that are specific to the
is new in HTML5
|charset||character-set||Not supported in HTML5.
Specifies the character encoding of the linked document
|Specifies how the element handles cross-origin requests|
|href||URL||Specifies the location (URL) of the linked document|
|hreflang||language-code||Specifies the language of the linked resource|
|media||media_query||Specifies on what device the linked document will be displayed|
|Specifies the relationship between the current document and the linked document|
|rev||reversed relationship||Not supported in HTML5.
Specifies the relationship between the linked document and the current document
|Specifies the size of the linked resource (only for rel="icon")|
|Not supported in HTML5.
Specifies where the linked document is to be loaded
|type||media-type||Specifies the media type of the linked document|
<link> tag supports the global attributes described in HTML Global Attributes Reference
<link> tag supports the event attributes described in HTML Events Reference
Last updated: Tuesday 25 Sep, 2018