🚀 LEVEL UP TO SENIOR:Unlock 500+ Advanced Practical Challenges & Expert Masterclasses.
🎓 COURSERA PARTNER:Earn professional Google, Meta, and IBM certificates to supercharge your resume.
REFERENCEhtml

html Documentation

LOADING ENGINE...

HTML <link> Tag

Link external resources. Master the head placement and required attributes.

link.html
1 / 7
🔗

Tutor:The <link> tag links external resources to your HTML document. It's a void element (no closing tag) that goes in the <head> section. Common uses include linking CSS stylesheets, favicons, fonts, and other resources.

Link Mastery

Unlock nodes by learning link attributes and resource linking.

Concept 1: The Link Tag

The <link> tag links external resources to your HTML document. It's a void element (no closing tag) that goes in the <head> section. Common uses include linking CSS stylesheets, favicons, fonts, and other resources.

System Check

Where should the <link> tag be placed in an HTML document?

Community Holo-Net

Share Resource Links

Created effective link structures for CSS, fonts, or favicons? Share your code and best practices with the network.

Enjoying this guide?

Codesyllabus is 100% free and open-source. Support our mission, pay for server infrastructure, and fuel new tutorials by buying us a coffee!

HTML <link> Element Guide

Author

Pascual Vila

Frontend Architect & Instructor.

The <link> tag links external resources to your HTML document. It's a void element (no closing tag) that goes strictly inside the <head> section. Common uses include linking CSS stylesheets, favicons, fonts, and optimizing resource loading.

Required Attributes

The rel attribute specifies the relationship between the document and the linked resource. Common values include: stylesheet for CSS files, icon for favicons, preconnect for DNS prefetching, and preload for resource preloading. The href attribute is mandatory and specifies the URL of the external resource.

Semantic Placement

Always place <link> tags in the <head> section. They should not be placed in the <body>. The browser prioritizes parsing the document head, ensuring essential resources like styles and fonts are fetched immediately.

Common Use Cases

  • Linking CSS stylesheets (rel="stylesheet")
  • Linking favicons for browser tabs (rel="icon")
  • Preconnecting to web font domains (rel="preconnect")

Link Tag Glossary

<link>
HTML void element that links external resources to the HTML document. Must be placed in the <head> section.
rel Attribute
Specifies relationship. e.g., stylesheet (CSS), icon (favicon), preconnect, preload.
href Attribute
Specifies the URL or path to the linked resource. Can be absolute or relative.
Head Placement
Ensures resources are requested early before page content rendering begins.