Programming

My HTML does not work: the 8 most common mistakes

Unclosed tags, wrong file names, encoding and more.

All lessons · HTML lessons: learn from scratch

8 typical mistakes

  1. Unclosed tag: <p> opened with no </p> — the rest of the page breaks.
  2. Wrong nesting: write <b><i>…</i></b>, not <b><i>…</b></i>.
  3. File name: a hidden .txt, like index.html.txt (show file extensions in Windows).
  4. Image path and case: Cat.jpg ≠ cat.jpg.
  5. Missing quote: href="a.html (no closing quote).
  6. Encoding: no <meta charset="utf-8"> — letters like ə, ö, ş break.
  7. The browser shows an old copy: hard-refresh with Ctrl+F5.
  8. You did not save the file (Ctrl+S).

Tools for checking

Press F12 in the browser and open Elements: it shows how the browser understood your HTML. For an official check use validator.w3.org.

Author: Nibras Code