WEB-DEVELOPMENT-APPLICATIONS practice question 4 of 25

Which element attaches an external CSS document to a web page?

Full set: 131 questions
Answer options
A:

A. <style>

B:

B. <Link>

Correct answer
C:

C. <Script>

D:

D. <Meta>

Correct Answer:
B. B. <Link>
Explanation

The element is the correct HTML tag for attaching external resources, most commonly an external CSS stylesheet. When used for this purpose, it is placed within the document's section. The rel attribute must be set to "stylesheet", and the href attribute must contain the URL of the CSS file to be linked. This method is the standard practice for applying external styles to a web page.

Why Incorrect

A. <style> is used to embed CSS rules directly within an HTML document (internal CSS), not to link an external file.
C. <script> is used to embed or reference executable scripts, typically JavaScript, not CSS stylesheets.
D. provides metadata about the HTML document, such as character set or viewport settings, but does not link external resources.

References

- Mozilla Developer Network (MDN). (n.d.). : The External Resource Link element. In HTML: HyperText Markup Language. Retrieved from https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link. (See "Linking to a stylesheet" section).

- WHATWG. (n.d.). 4.2.4 The link element. In HTML Living Standard. Retrieved from https://html.spec.whatwg.org/multipage/semantics.html#the-link-element. (See example under "4.2.4.2. Processing the rel attribute").

- W3C. (2011, May 25). CSS basics. In CSS Snapshot 2010. Retrieved from https://www.w3.org/TR/CSS2/intro.html#q1.

Question breakdown

Tests
Link external stylesheets to HTML
Difficulty
Easy

Key idea: An external CSS file is attached with a element in the head.

How to reach the answer

  1. The clue is the word 'external' CSS document.
  2. holds CSS written inside the page, so it does not attach an external file.
  3. loads JavaScript, and supplies metadata about the page.
  4. with rel="stylesheet" references an external CSS file.

Each option

  • AIncorrect. contains internal CSS embedded in the page and does not reference a separate file.
  • BCorrect. is the standard way to attach an external stylesheet.
  • CIncorrect. embeds or loads scripts such as JavaScript, not CSS.
  • DIncorrect. provides metadata such as the charset or viewport and does not load stylesheets.

Common trap: Choosing because it is associated with CSS, even though it is for internal styles only.

In practice: Almost every site loads shared stylesheets through tags in the head so that many pages can reuse the same CSS and browsers can cache it.

Remember: Use for external CSS and for internal CSS.

Drafted with AI assistance and checked against the answer key.

Keep practicing

Take the free WEB-DEVELOPMENT-APPLICATIONS practice test

Ten exam-style questions with answers and explanations, plus the exam facts and study guides.

Start the free practice test

More questions

Other WEB-DEVELOPMENT-APPLICATIONS practice questions

Scroll to Top