How do you link a CSS file to an HTML document?

Instruction: Demonstrate how to include a CSS stylesheet in an HTML document.

Context: This question tests the candidate's understanding of how to connect CSS styles to an HTML document, a fundamental skill in web development.

Official answer available

Preview the opening of the answer, then unlock the full walkthrough.

rel: This attribute specifies the relationship between the HTML document and the linked file. In the case of linking a CSS file, we set the value to "stylesheet" to indicate that the linked file is a stylesheet.

type: This attribute defines the MIME type of the linked document. For CSS stylesheets, the MIME type is "text/css"....

Related Questions