Final answer:
The tag in HTML links to external style sheets with attributes like 'rel', 'href', and 'type', which define the relationship, source, and type of the linked document respectively.
Step-by-step explanation:
The <link> tag in HTML is used to define a relationship between the current document and an external resource, which is commonly used to link to external style sheets. When referring to a style sheet, the <link> tag includes several attributes that specify the nature of the relationship and how the resource should be handled by the browser.
Essential Attributes of the <link> Tag
- rel: This attribute specifies the relationship between the current document and the linked document. For style sheets, the value is usually 'stylesheet' to indicate that the linked file is a style sheet.
- href: This is the most important attribute, which provides the URL of the linked document. It is essential for the browser to know the location of the style sheet to apply.
- type: This attribute declares the MIME type of the linked document. For CSS files, the type should be 'text/css'.
Optional Attributes
- media: Describes what device the style sheet is optimized for, such as 'print' or 'screen'.
- title: Can be used to name the style sheet, which can be helpful when using alternate style sheets.
These attributes help ensure that the web page is displayed with the intended style by linking to the appropriate CSS file in a structured and recognizable way.