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

xhtml syntax rules · the five musts

Pixel PeteVSQuirks Mode
Pixel Pete saysThe five "musts" are the heart of XHTML — memorize them and your markup is XML-clean.

Restated as a checklist you can apply to any markup: (1) doctype declared, (2) elements lowercase, (3) everything closed, (4) attributes quoted, (5) properly nested. These same habits make HTML5 cleaner too — which is the real reason to learn XHTML even though you'll author HTML5.

Power-ups you unlock

Quirks Mode attacks — common mistakes

Boss battleRun a messy snippet through the five-point checklist and correct each violation.

Example code

<!doctype html><html><head><meta charset="utf-8"></head>
<body style="background:#06040d;color:#e6e0ff;font-family:monospace;padding:20px"><pre>checklist:
[ ] doctype   [ ] lowercase   [ ] closed
[ ] quoted    [ ] nested</pre></body></html>
▶ Open the interactive comic issue
‹ Xhtml Vs Html · The DifferencesXhtml Doctype · The Required Header ›