- Courses
- HTML
- HTML top level tags
- <link>
- Significance of the type attribute in link
What is the significance of the type
attribute in the <link>
element?
The type
attribute specifies the MIME type of the linked resource.
The type
attribute in the <link>
element defines the MIME type of the linked resource, such as text/css
for stylesheets. This helps the browser understand the nature of the resource being linked, ensuring it is handled correctly. While often omitted for stylesheets, it is crucial for other resource types to ensure compatibility and proper loading.
<link rel="stylesheet" href="style.css" type="text/css" />