Homework

Homework — check it and break it

Homework — check your page, then break it deliberately.

  1. Run it through a server. Make sure index.html sits in a folder and has a heading (<h1>), a paragraph (<p>) and a link (<a>). Run npx serve (or python3 -m http.server, or "Live Server") and open http://localhost:3000. The page must work, and the link must go to NASA.
  2. Validate it. Go to validator.w3.org, paste your whole HTML into the "Validate by Direct Input" tab and press "Check". Read what it says and fix every error and warning until you get the green "Document checking completed. No errors or warnings to show." The validator is an objective second reader — you'll use it the whole way through.
  3. Break the encoding. Change the heading to Lithuanian, delete <meta charset="UTF-8">, reload. Remember what the broken text looks like — you'll recognise it in a real project. Put the line back.
  4. Break it with file://. Stop the server and open the same index.html by double-clicking it (an address like file:///…). Today this page still works — but open the console (F12 → Console) and note that there are no requests here at all: the file is read straight off the disk, not through a server. Go back to localhost and compare the Network tab: through a server you see a real request with a status code. That is the difference the served folder buys you.

Required result:

  • The page works over http://localhost:3000 and has a heading, a paragraph and a link.
  • The validator is green — zero errors, zero warnings.

To submit: screenshots of (1) the page working over localhost, (2) the green validator result, (3) the broken text after deleting <meta charset>.