HTML <link> tag
HTML <link> tag
The <link>
tag defines a relationship between an HTML document and an external resources (CSS stylesheets).
Example
HTML Online Editor
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="style.css">
</head>
<body>
<h1>This is a Heading.</h1>
<p>This is a Paragraph.</p>
</body>
</html>
Attributes
The following are the attributes of <link> tag. Also try Global attributes.
Attribute | Value | Explanation |
---|---|---|
as |
| Specifies the type of content being loaded by the <link> element. It works only with rel="preload". |
crossorigin |
| Specifies whether CORS must be used when fetching the resource. |
href | URL | Specifies the URL of the linked resource. |
hreflang | language_code | Specifies the language of the linked resource. |
integrity | value | Specifies the fetched resource has been delivered free of unexpected manipulation. |
media | media_query | Specifies on what device the linked resource will be displayed. |
referrerpolicy |
| Specifies whether or not to sent http referrer information. |
rel |
| Specifies the relationship between the current document and the linked document. |
sizes |
| Specifies the size of the linked resource. Works only with rel="icon". |
title | text | Specifies the name of the style which is shown in the browser's menubar. |
type | media_type | Specifies the media type of the linked resource. |
Deprecated Attributes
The following attributes should not be used in any case.
Attribute | Value | Explanation |
---|---|---|
charset | character_encoding | Specifies the character encoding of the linked document. |
rev | text | Specifies the relationship between the linked document and the current document. |
target |
| Specifies where the linked document should be opened. |
Reminder
Hi Developers, we almost covered 99.5% of HTML Tutorials with examples for quick and easy learning.
We are working to cover every Single Concept in HTML.
Please do google search for:
Join Our Channel
Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.
This channel is primarily useful for Full Stack Web Developer.