freecoding.school100% FREE · NO SIGNUP
The Old NetISSUE #11 of 60

the document must be well-formed

Pixel PeteVSQuirks Mode
Pixel Pete saysAn XHTML document must be "well-formed" — a single valid XML tree with no syntax errors.

"Well-formed" is XML's baseline: one root element, every tag closed and nested, entities escaped, no stray characters. It's separate from "valid" (matching the DTD). A well-formed-but-invalid doc parses; a non-well-formed one fails entirely. Well-formedness is the non-negotiable floor.

Power-ups you unlock

Quirks Mode attacks — common mistakes

Boss battleDistinguish a well-formed-but-invalid doc from a non-well-formed one.

Example code

<!doctype html><html><head><meta charset="utf-8"></head>
<body style="background:#06040d;color:#e6e0ff;font-family:monospace;padding:20px"><pre>not well-formed: &lt;p&gt;a &amp; b   (raw &amp;)
well-formed:     &lt;p&gt;a &amp;amp; b&lt;/p&gt;</pre></body></html>
▶ Open the interactive comic issue
‹ Boolean Attributes · Expanded FormXhtml Validation · The Strict Parser ›