Skip to content

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

688 people viewed this

Document Structure

  • True is incorrect because DOCTYPE is a declaration, not an HTML element.
  • False is correct because <!DOCTYPE html> is written as a standalone declaration.

Question 6: What is the DOM?

  1. A database that stores every website's HTML.
  2. A CSS file generated by the browser.
  3. A structured document representation that scripts and browser features can access.
  4. A protocol used to transfer HTML from a server.

Correct answer: C — A structured document representation.

  • A is incorrect because the DOM is not a website database.
  • B is incorrect because the DOM is not a CSS stylesheet.
  • C is correct because the DOM represents the document as a structure of nodes and objects.
  • D is incorrect because HTTP and HTTPS are communication protocols.

Question 7: True or False — The viewport meta element automatically makes every webpage responsive.

  1. True
  2. False

Correct answer: B — False.

  • True is incorrect because viewport metadata does not automatically create responsive layouts.
  • False is correct because responsive behavior also depends on suitable CSS, layout choices and content.

Question 8: What does a browser commonly do when it encounters a new p start tag while another paragraph is still open?

  1. It always stops parsing the document.
  2. It treats the new p element as a CSS rule.
  3. It converts both paragraphs into one heading.
  4. It closes the previous paragraph during HTML parsing.

Correct answer: D — It closes the previous paragraph during HTML parsing.

  • A is incorrect because browsers generally attempt to recover from common HTML errors.
  • B is incorrect because p is an HTML element, not a CSS rule.
  • C is incorrect because a paragraph start tag does not convert content into a heading.
  • D is correct because HTML parsing rules close an open paragraph when a new p start tag is processed in this context.

Question 9: Which attribute identifies the primary language of an HTML document?

  1. lang
  2. charset
  3. viewport
  4. rel

Correct answer: A — lang.

  • A is correct because lang identifies the language of the document or element.
  • B is incorrect because charset specifies character encoding.
  • C is incorrect because viewport is used in viewport metadata.
  • D is incorrect because rel describes a relationship between a linked resource and the current document.

Question 10: What is a common effect of omitting a suitable DOCTYPE from an HTML document?

  1. The browser cannot display any HTML content.
  2. The browser may enter quirks mode.
  3. The browser automatically adds a server-side framework.
  4. The browser disables all CSS permanently.

Correct answer: B — The browser may enter quirks mode.

  • A is incorrect because browsers can still parse and display HTML without DOCTYPE.
  • B is correct because a missing or legacy-triggering DOCTYPE can cause quirks mode.
  • C is incorrect because a browser does not add a server-side framework.
  • D is incorrect because omitting DOCTYPE does not permanently disable CSS, although rendering behavior can change.

Congratulations!

You have completed Section 2 of Codementrix HTML5 Mastery. You now understand the structure of an HTML document, the purpose of DOCTYPE, metadata, character encoding, browser parsing and the DOM.

Next lesson: Section 3 — HTML Elements, Tags, Attributes and Nesting Rules.

Rate this course

5.0 · 1 rating

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

Your stars