1D0-61B · Question #56
Consider the following HTML5 code: The code does not validate as HTML5. Why?
The correct answer is C. The <blockquote> tag should be used outside the <p> tags. <blockquote> is a block-level element, and HTML5 prohibits nesting block-level elements inside <p> tags - <p> only accepts phrasing (inline) content. Placing <blockquote> inside <p> is a content-model violation that causes the validator to fail. Why the distractors are wrong: A…
Question
Consider the following HTML5 code:
The code does not validate as HTML5. Why?
Exhibit
Options
- AThe <article> tag is missing.
- BThe <meta> tag and its attributes are missing.
- CThe <blockquote> tag should be used outside the <p> tags.
- DThe !DOCTYPEdeclaration is missing a reference to the Document Type Definition (DTD).
How the community answered
(34 responses)- A3% (1)
- B9% (3)
- C85% (29)
- D3% (1)
Explanation
<blockquote> is a block-level element, and HTML5 prohibits nesting block-level elements inside <p> tags - <p> only accepts phrasing (inline) content. Placing <blockquote> inside <p> is a content-model violation that causes the validator to fail.
Why the distractors are wrong:
- A -
<article>is a semantic element but is never required; omitting it doesn't break validation. - B - A
<meta charset>tag is best practice but its absence alone does not cause a validation failure in HTML5. - D - This is a trap that tests knowledge of HTML5's simplified DOCTYPE:
<!DOCTYPE html>is intentionally DTD-free, unlike HTML 4.01/XHTML, so referencing a DTD is not only unnecessary but incorrect for HTML5.
Memory tip: Think "P is for Phrasing only" - <p> can only hold inline content like <span>, <a>, or <strong>. Any time you see a block element (<blockquote>, <div>, <section>) sitting inside a <p>, that's an automatic validation failure.
Topics
Community Discussion
No community discussion yet for this question.
