WEB-DEVELOPMENT-APPLICATIONS practice question 4 of 25
Which element attaches an external CSS document to a web page?
Full set: 131 questionsThe 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.
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.
- 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
Key idea: An external CSS file is attached with a element in the head.
How to reach the answer
- The clue is the word 'external' CSS document.
- holds CSS written inside the page, so it does not attach an external file.
- loads JavaScript, and supplies metadata about the page.
- with rel="stylesheet" references an external CSS file.
Each option
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.
More questions
Other WEB-DEVELOPMENT-APPLICATIONS practice questions
- Question 1Given the following JavaScript code: ```javascript var n1 = 10; var n2 = "20.39"; ``` Whi…
- Question 2Which attribute displays help text in an input field without specifying an actual value f…
- Question 5Which HTML tag should a developer use to create a drop-down list?
- Question 6Which method allows the end user to enter text as an answer to a question as the page loa…
- Question 8Which layout design is easiest to manage on a variety of devices?
- Question 9Which structure tag should a developer use to place contact information on a web page?
