Common Mistakes and How to Find Them
Common Mistakes and How to Find Them
~8 Min. Lesezeit Zuletzt aktualisiert am August 8, 2026
Along the way here, you've probably already made a mistake or two - that's completely normal and part of programming! In this chapter we'll gather up the most common mistakes once more, and look at how to find them systematically.
The five most common beginner mistakes
A summary of the mistakes already warned about throughout this tutorial:
- Forgotten closing tags (chapter 4): a
<p>without a</p>, or tags closed in the wrong order. - Missing or wrong quotes on attributes (chapter 13):
href=https://...instead ofhref="https://...". - Wrong file or folder names in relative paths (chapters 14 and 17): capitalisation or typos in
src/href. - Using id instead of class when a value appears multiple times (chapter 35): leads to invalid HTML if the same
idis assigned twice. - label not correctly connected with for/id (chapter 28): the label is then visible but technically not connected to the field.
Viewing the source code in your browser
An extremely useful tool you probably don't know yet: almost every browser shows you the actual HTML code of any website when you right-click and select "View Page Source" (or "Inspect"/"Inspect Element"). This is great for understanding how other websites are built - try it on your favourite sites!
Systematically hunting for mistakes
If your page doesn't look the way you expect, go about it systematically:
- Save first, then reload: sounds trivial, but a forgotten save click is the most common cause of "my change isn't working".
- Read from top to bottom: open the page source and read your HTML code line by line - does every opening bracket have a matching closing one?
- Check the most recently changed part first: if something broke, it's usually the most recently added or changed line.
- Undo and re-add step by step: if you're completely stuck, undo the last changes with
Ctrl+Zand add them back in smaller steps, saving and testing after each one.
An online HTML validator
There are free websites that automatically check your HTML code for mistakes - for example, the official W3C validator (validator.w3.org). You can either upload a file there or paste code directly, and get back a list of possible problems, often with an exact line number.
Tipp: A validator sometimes flags things that are technically "good enough" to still work in the browser - treat the messages as helpful hints, not absolute truth. But if something looks broken and you don't know why, running a validator is almost always a good first step.
Achtung: Browsers are very "tolerant": they try to display even broken HTML in some sensible way, instead of simply showing an error message like some other programming languages do. This is convenient, but it can also mean a mistake stays unnoticed for a long time, until it causes a visible problem somewhere unexpected.