
- HTML Tutorial
- HTML - Home
- HTML - Overview
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Comments
- HTML - Images
- HTML - Tables
- HTML - Lists
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Frames
- HTML - Iframes
- HTML - Blocks
- HTML - Backgrounds
- HTML - Colors
- HTML - Fonts
- HTML - Forms
- HTML - Embed Multimedia
- HTML - Marquees
- HTML - Header
- HTML - Style Sheet
- HTML - Javascript
- HTML - Layouts
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- HTML - Fonts Ref
- HTML - Events Ref
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
How to add a resource reference in HTML?
Use the <link> tag to add a resource reference. The HTML <link> tag is used for defining a link to an external document. It is placed in the <head> section of the document.
The following are the attributes −
Attribute | Value | Description |
---|---|---|
charset | charset | Defines the character encoding of the linked document. |
href | URL | Specifies the URL of the resource document. |
hreflang | language | Language code of the destination URL |
media | screen tty tv projection handheld braille aural all | Specifies the device the document will be displayed on |
rel | alternate appendix bookmark chapter contents copyright glossary help home index next prev section start stylesheet subsection | Describes the relationship between the current document and the destination URL. |
rev | alternate appendix bookmark chapter contents copyright glossary help home index next prev section start stylesheet subsection | Describes a reverse between the destination URI and the current document. |
sizes![]() | HeightxWidth | Specifies the size of the linked resource. |
target | blank _self _top _parent | Specifies the target frame to load the page into. |
type | mimetype | The MIMEtype of content at the link destination |
Example
You can try to run the following code to add a resource reference in HTML −
<!DOCTYPE html> <html> <head> <title>HTML link Tag</title> <link rel = "stylesheet" href = "stylenew.css"> </head> <body> <div id = "contentinfo"> <p>Welcome to our website. We provide tutorials on various subjects.</p> </div> </body> </html>
- Related Articles
- How to reference embedded Docker resource files using file path URL?
- How to add a layer in HTML?
- How to add a paragraph in HTML?
- How to add a variable in HTML?
- How to add a list item in HTML?
- How to add a set of frames in HTML?
- How to add a spellchecker for text in HTML?
- How to add a base font in a HTML page?
- How to add video in HTML page?
- How to add background music in HTML?
- How to add preformatted text in HTML?
- How to add horizontal line in HTML?
- How to add emoji in HTML document?
- How to get Resource name using Resource id in Android?
- How to add a parameter for an object in HTML?

Advertisements