Command Palette

Search for a command to run...

Hectal
Back to the lesson: Topic 7.7 — HTML Best Practices and Common Mistakes
HTML · Example 2 of 3

What the browser makes of old and unknown tags

center, font and marquee are obsolete but still supported for old pages; blink is gone entirely. All four are invalid in modern HTML. Use CSS for looks.

Good HTML picks the element that matches the meaning, keeps structure and order logical, avoids deprecated and fake controls, and stays lean for speed; these are the mistakes reviewers spot first.

Change the code and press Run (Ctrl+Enter). Predict what will happen first, then break it on purpose and read what changes. Your edits are saved and match the lesson page.

Ready for more? This phase has 6 hands-on exercises with automatic checks.

Practice questions

Write the code in the editor, run it, then open the model answer to compare.

01

Rewrite this as semantic HTML: <div class="nav"><span onclick="location='/'">Home</span> <span onclick="location='/blog'">Blog</span></div><div class="h">My Blog</div>.

02

Find and fix four mistakes: <img src="chart.png"><a href="report.pdf">Click here</a><br><br><br><font size="2">Updated 2024</font>.

Explain it without notes

01

What is div soup, and why is it a problem beyond accessibility?

02

When should you use a link and when a button?

03

Why is <div /> a bug in HTML but fine in React?

04

Name five HTML habits that improve performance.

What the browser makes of old and unknown tags

Preview

Press Run to see the page.

Console

Nothing logged yet.

Expected console output

center -> HTMLElement
font -> HTMLFontElement
marquee -> HTMLMarqueeElement
blink -> HTMLUnknownElement
button -> HTMLButtonElement