- Courses
- HTML
- HTML top level tags
- <link>
- Purpose of the <link> element in HTML
What is the purpose of the <link>
element in HTML?
The <link>
element connects external resources to the document.
The <link>
element in HTML is used to link external resources, such as stylesheets, to the document. It is typically placed within the <head>
section and is essential for including CSS files, favicons, and other linked resources. The <link>
element does not display content directly but provides metadata about the document or links to external files that affect the document's presentation or behavior.
<head>
<link rel="stylesheet" href="styles.css">
<link rel="icon" href="favicon.ico">
</head>