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

what is xhtml · html as xml

Pixel PeteVSQuirks Mode
Pixel Pete saysXHTML is HTML reformulated as strict XML — same tags, far stricter rules.

XHTML (Extensible HyperText Markup Language) takes the familiar HTML vocabulary and makes it obey XML's rigid grammar: every tag closed, lowercase, quoted, and perfectly nested. The goal was machine-parseable, unambiguous markup. It's largely historical now — HTML5 won — but learning its discipline makes your HTML cleaner.

Power-ups you unlock

Quirks Mode attacks — common mistakes

Boss battleSpot the differences between a sloppy HTML snippet and its strict XHTML equivalent.

Example code

<!doctype html><html><head><meta charset="utf-8"></head>
<body style="background:#06040d;color:#e6e0ff;font-family:monospace;padding:20px"><pre>html5:  &lt;IMG SRC=pic.png&gt;&lt;BR&gt;
xhtml:  &lt;img src="pic.png" /&gt;&lt;br /&gt;
        (lowercase · quoted · self-closed)</pre></body></html>
▶ Open the interactive comic issue
Why Xhtml Existed · The Strictness Pitch ›