What is the correct syntax to link an external stylesheet in HTML?

Prepare for the WebXam Web Development Test with flashcards and multiple-choice questions, each featuring hints and explanations. Ace your web development exam!

To link an external stylesheet in HTML, the correct syntax is the use of the <link> tag with the attributes rel and href. The rel attribute specifies the relationship between the current document and the linked resource—setting it to "stylesheet" indicates that the linked file is a stylesheet. The href attribute specifies the location of the stylesheet file, typically a CSS file, which in this case is "styles.css".

Using this structure allows the browser to properly locate and apply the styles defined in the external stylesheet to the HTML document. This is fundamental in web development as it enables the separation of content (HTML) and presentation (CSS), promoting cleaner and more maintainable code.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy