In this lesson, you checked Rosa’s draft of a Visit the Garden page, which looked almost right and put nothing in the Console. You found its silent mistakes in three steps: the validator, the Elements panel next to the file, and the Accessibility pane.
Key Points
- HTML never reports a mistake. The browser repairs what it can and shows the page anyway, and the Console stays empty, so you check a page yourself.
- Step one, the validator. The W3C’s validator, the Nu Html Checker at
https://validator.w3.org/nu/, checks your file against HTML’s rules. Your live preview’s address works only on your own computer, so choose text input in its Check by menu, paste the whole file into the box, and click Check. - Read the first errors together. For Rosa’s draft, one missing
</a>gave four errors. The first two point at line 10: “End tag p seen, but there were open elements.” and “Unclosed element a.” Together they say the paragraph ended while the link was still open. The last two, at</main>and</body>, are the same open link, still open further down. So you add the link’s end tag,</a>after “plot map”, and leave alone the</p>that the first error highlights. - Step two, the Elements panel next to your file. The validator says what’s wrong in the file, and the Elements panel shows what the browser did about it. As with Rosa’s unclosed
<em>in her watering rota, the parser closed the<a>at the end of the paragraph and then opened a new one before the next paragraph, so that paragraph’s</p>couldn’t close it. - That second
<a>, which isn’t in the file, stayed open to the end of<main>and wrapped the opening times and the photo, so both led to the plot map, and a third, empty<a>followed</main>. The validator’s one open link became three links in the tree. - Watch out: a missing end tag doesn’t stay on its own line. When a link or italics leak further down a page, look for the first unclosed element above them.
- With
</a>added, the tree matched the file, with one<a>inside the first paragraph, and the validator showed no errors or warnings. Warnings flag markup that’s allowed but worth a second look, and Rosa’s page had none. - Step three, the Accessibility pane. The validator checks the rules for writing HTML, not what an element means to a visitor. When you selected the
<img>and opened the Accessibility tab, beside Styles, the pane showed its role, image, and its name, photo. That’s what a screen reader announces. That’s valid HTML, and it tells a visitor nothing. - With alt text that says what the photo shows, “Plot 7 in August, full of staked tomatoes”, the name changes to match. The validator passes both versions, so only your own reading, with the pane’s help, can tell which one helps.
Final Code
Rosa’s page, with the link closed and the photo’s alt text rewritten: