HTML <link> tag
When writing in HTML, the <link> tag is used to create a link between a web page and an external resource. It is useful for defining a framework for navigation purposes or, more typically, linking a CSS file to adjust the layout and appearance of a website. The following sections contain information about this tag, including an example of its code, as well as related attributes and browser compatibility.
<link rel="stylesheet" type="text/css" href="layout.css">
Within an HTML tag, an attribute dictates certain aspects of an HTML element. Attributes are made up of a name and value pair; all tags support standard attributes. The following table shows all of the current unique HTML attributes for the <link> tag, as well as a description of each.
|crossorigin||Designates how related images are fetched.|
|href||Designates the location of the linked document.|
|hreflang||Designates the language of the text in a linked document.|
|media||Designates device on which a linked document is displayed.|
|rel||Designates the relationship between the current document and a linked one (required).|
|sizes||Designates the size of the linked resource. Only to be used with rel="icon".|
|type||Designates the type of media is contained in a linked resource.|
A deprecated attribute is one that may function currently but is not supported in going forward. While the attribute may work with the current version of HTML, it will eventually be phased out. It is better to avoid using these attributes to help future-proof your website.
|charset||Designates how a linked documents characters are encoded.|
|rev||Designates the relationship between a linked document and the current one.|
|target||Designates where to load a linked resource.|
|All versions||All versions||All versions||All version||All versions||All versions|