What is the correct HTML for referring to an external style sheet?

Prepare for the Web Development 201 Test. Study with flashcards, multiple-choice questions, and detailed explanations. Get exam-ready!

Using <link rel="stylesheet" href="mystyle.css"> is the correct way to refer to an external style sheet in HTML. The <link> element is designed specifically for linking external resources, and when it comes to CSS, the attributes used are crucial.

The rel attribute defines the relationship between the current document and the linked resource, and "stylesheet" indicates that the link is to a style sheet. The href attribute specifies the location of the external CSS file, which in this case is "mystyle.css". This syntax is standard practice in HTML and ensures that the browser correctly identifies and applies the styles from the specified file to the document.

The other options deviate from this standard syntax. Some incorrectly use src instead of href, while others misuse the attributes by employing an incorrect attribute (like url). The proper use of href in conjunction with rel="stylesheet" is what accurately establishes the connection to an external style sheet.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy