Homework
Homework — check it and break it
Homework — check your page, then break it deliberately.
- Run it through a server. Make sure
index.htmlsits in a folder and has a heading (<h1>), a paragraph (<p>) and a link (<a>). Runnpx serve(orpython3 -m http.server, or "Live Server") and openhttp://localhost:3000. The page must work, and the link must go to NASA. - 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.
- 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. - Break it with
file://. Stop the server and open the sameindex.htmlby double-clicking it (an address likefile:///…). 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 tolocalhostand 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:3000and 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>.