Skip to content

Courses / HTML5 Mastery: Complete Beginner to Advanced Course / Document Structure

686 people viewed this

Document Structure

Identify and correct the structural problems in this example:

<html>
<body>
    <title>My Page</title>
    <h1>Welcome</h1>
</body>
</html>

Your corrected version should use a suitable DOCTYPE and place the title in the appropriate part of the document.

17. Section 2 Quiz

Answer these 10 questions to check your understanding. Try to solve them before revealing the answer and explanation for each question.

Question 1: What is the primary purpose of the HTML5 DOCTYPE declaration?

  1. To load an external stylesheet.
  2. To help the browser use standards mode.
  3. To declare the document's primary language.
  4. To execute JavaScript before parsing HTML.

Correct answer: B — To help the browser use standards mode.

  • A is incorrect because stylesheets are commonly connected using link.
  • B is correct because the HTML5 DOCTYPE helps browsers use standards-oriented rendering.
  • C is incorrect because the lang attribute identifies the document language.
  • D is incorrect because DOCTYPE does not execute scripts.

Question 2: Where should the title element normally be placed?

  1. Inside head.
  2. Inside body.
  3. Inside footer.
  4. Inside a paragraph element.

Correct answer: A — Inside head.

  • A is correct because title is metadata content that belongs in head.
  • B is incorrect because title is not intended to be placed in body.
  • C is incorrect because footer is a body content element.
  • D is incorrect because title cannot be nested inside a paragraph.

Question 3: Which declaration specifies UTF-8 character encoding?

  1. <meta name="language" content="UTF-8">
  2. <meta charset="UTF-8">
  3. <title charset="UTF-8">
  4. <html charset="UTF-8">

Correct answer: B — meta charset="UTF-8".

  • A does not use the standard charset declaration.
  • B is correct because the charset attribute declares the document encoding.
  • C is incorrect because title does not declare the document's character encoding.
  • D is incorrect because charset is not used this way on the html element.

Question 4: Which two elements are normally direct children of the root html element?

  1. head
  2. body
  3. title
  4. footer

Correct answers: A and B.

  • A is correct because head is normally a direct child of html.
  • B is correct because body is normally a direct child of html.
  • C is incorrect because title belongs inside head.
  • D is incorrect because footer is normally part of body content.

Question 5: True or False — The HTML5 DOCTYPE is a normal HTML element with an opening and closing tag.

  1. True
  2. False

Correct answer: B — False.

Rate this course

5.0 · 1 rating

Stars show on this course. Your written note stays private.

Your stars