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

proper nesting · no overlap allowed

Pixel PeteVSQuirks Mode
Pixel Pete saysElements must nest without overlapping — close the inner element before the outer.

XML requires a strict tree: <b><i>text</i></b> is valid, but the overlapping <b><i>text</b></i> is not. HTML browsers quietly fix overlaps; XHTML parsers reject them. Always close in reverse order of opening — last opened, first closed.

Power-ups you unlock

Quirks Mode attacks — common mistakes

Boss battleFix an overlapping <b>/<i> pair so they nest correctly.

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;b&gt;&lt;i&gt;x&lt;/b&gt;&lt;/i&gt;
valid:   &lt;b&gt;&lt;i&gt;x&lt;/i&gt;&lt;/b&gt;</pre></body></html>
▶ Open the interactive comic issue
‹ All Tags Must Close · Self-Closing TooAttribute Values · Always Quoted ›