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.

Updated

Official answer available

Read the opening below, then unlock the full answer and practical guidance.

Place a link element with rel="stylesheet" and the stylesheet URL in the document's head:

<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>Styled catalog</title> <link rel="stylesheet" href="styles.css"> </head> <body><h1>Catalog</h1></body> </html>...

Related Questions