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

all tags must close · self-closing too

Pixel PeteVSQuirks Mode
Pixel Pete saysEvery element must close — including void elements, written as self-closing <br />.

XML has no implicitly-closed tags. Container elements need a closing tag (<p>…</p>); void elements that have no content must self-close with a trailing slash: <br />, <img … />, <input … />, <hr />, <meta … />. (In HTML5 the slash is optional.)

Power-ups you unlock

Quirks Mode attacks — common mistakes

Boss battleSelf-close every void element in a snippet and close every container.

Example code

<!doctype html><html><head><meta charset="utf-8"></head>
<body style="background:#06040d;color:#e6e0ff;font-family:monospace;padding:20px"><pre>invalid: &lt;br&gt; &lt;img src="x"&gt;
valid:   &lt;br /&gt; &lt;img src="x" /&gt;</pre></body></html>
▶ Open the interactive comic issue
‹ All Tags Lowercase · The Case RuleProper Nesting · No Overlap Allowed ›