Chapter 1 Chapter 2 Chapter 3 Chapter 4 Chapter 5 Chapter 6 Chapter 7 Chapter 8 Chapter 9 Chapter 10 Chapter 11 Chapter 12 Chapter 13 Chapter 14

Chapter 2 quiz

10 questions · instant feedback after each answer.

1.

Which is the correct HTML5 doctype?

Correct answer: B. <!DOCTYPE html> is the HTML5 doctype and must be the very first line of the document.
2.

Which of these is a void (empty) element?

Correct answer: C. <img> is a void element: it has no closing tag. In HTML5 the trailing slash is optional.
3.

Which attribute provides alternative text for an image?

Correct answer: B. alt describes the image for screen readers and is shown when the image fails to load.
4.

Which heading element represents the main page title?

Correct answer: B. <h1> is the main topic, and there should be only one per page.
5.

Which input type automatically validates an email address?

Correct answer: C. <input type="email"> gives built-in browser validation for email format.
6.

Which semantic element is used for primary navigation links?

Correct answer: B. <nav> marks a navigation landmark for menus, breadcrumbs and pagination.
7.

Which attribute opens a link in a new tab?

Correct answer: A. target="_blank" opens a new tab. Pair it with rel="noopener noreferrer" for security.
8.

Which character entity represents an ampersand (&)?

Correct answer: A. &amp; is the named entity for &. Always encode <, > and & in text content.
9.

How do you associate a <label> with a form <input>?

Correct answer: B. The label's for value must match the input's id value for full accessibility.
10.

Which statement about HTML tables is correct?

Correct answer: B. Tables are for tabular data only. Use CSS Grid or Flexbox for page layout.