Forms and debugging
Validate your HTML
Use an HTML validator to find invalid nesting, missing attributes, duplicate IDs, and other mistakes a forgiving browser may silently repair.
Browsers try to render invalid HTML. That is useful for visitors, but it can hide mistakes from you.
An HTML validator checks your source against the standard. Use the Nu HTML Checker and either paste your markup, upload a file, or enter a public URL.
The checker can find problems such as:
- elements nested where they are not allowed
- missing required attributes
- duplicate IDs
- obsolete elements or attributes
- unclosed tags that change the document tree
Read the first error first. One broken tag can cause several later messages, and fixing it may remove the others.
A validator checks syntax and structural rules. It cannot tell whether your heading is useful, your link text is clear, or your alt text describes the important part of an image.
Treat validation as one part of the review:
- validate the markup
- inspect the page in the browser
- use it with the keyboard
- read the content as a visitor would
Valid HTML is not automatically good HTML, but invalid HTML makes good results harder to trust.
I validate local files by upload when the page is not public yet. For a live page, the URL check is faster. Either way, fix errors in the source file, not in DevTools.
Warnings deserve a look too. Some are safe to ignore on purpose (legacy attributes on third-party embeds, for example). Read the message and decide. Do not blanket-ignore everything.
After you fix an error, validate again. A clean result means the parser and assistive tools can trust your structure. That is the baseline I want before CSS and JavaScript enter the picture.
Lesson completed