Written Test Document Structure 3 — Questions and Answers
Question 1: Which element should be used to mark up the author information for an <article>?
- <span>
- <cite>
- <address> (Correct answer)
- <author>
Correct answer: <address>
The <address> element within an <article> marks up contact or authorship information for that article.
Question 2: What is the purpose of the <base> element in an HTML document?
- It defines the base font size for the page
- It sets the base URL and/or target for all relative URLs in the document (Correct answer)
- It creates a foundation stylesheet link
- It marks the bottom of the page structure
Correct answer: It sets the base URL and/or target for all relative URLs in the document
The <base> element specifies a base URL that all relative links in the document will be resolved against.
Question 3: Which attribute on a <script> tag tells the browser to download the script without blocking HTML parsing and execute it after parsing is complete?
- async
- defer (Correct answer)
- lazy
- preload
Correct answer: defer
The `defer` attribute makes the script download in parallel but execute only after the HTML document has been fully parsed.
Question 4: Which element is used to define a caption for a <table>?
- <th>
- <summary>
- <caption> (Correct answer)
- <title>
Correct answer: <caption>
The <caption> element provides an accessible title for a table and must be the first child of the <table> element.
Question 5: What does the `rel="noopener"` attribute on an anchor tag prevent?
- The linked page from accessing the opener window via `window.opener` (Correct answer)
- Search engines from following the link
- The browser from opening a new tab
- CSS styles from being applied to the link
Correct answer: The linked page from accessing the opener window via `window.opener`
The `rel="noopener"` attribute prevents the newly opened page from accessing the parent window's context through `window.opener`.
Question 6: Which element marks up a short inline quotation in HTML?
- <blockquote>
- <cite>
- <q> (Correct answer)
- <quote>
Correct answer: <q>
The <q> element is for short inline quotations; browsers typically add quotation marks around its content automatically.
Question 7: What is the correct structure for an HTML table row containing header cells?
- <tr><td scope="col">Header</td></tr>
- <thead><th>Header</th></thead>
- <tr><th>Header</th></tr> (Correct answer)
- <row><header>Header</header></row>
Correct answer: <tr><th>Header</th></tr>
Header cells use the <th> element inside a <tr>; grouping them in <thead> is best practice but <tr><th> is the correct minimum structure.
Which element should be used to mark up the author information for an ?