To debug HTML, compare the browser’s live DOM with the source, run the document through an HTML validator, fix the markup the diagnostics point to, and reload to confirm the result. Browsers often repair malformed HTML, so a page that looks acceptable can still have incorrectly authored markup.
Start with the browser’s live DOM
- Reproduce the problem. Note the exact text, link, or section that looks wrong and what you expected to see.
- Inspect the affected node. Open your browser’s developer tools and select the element in the DOM inspector. Check its parent and child elements against the structure you intended. Selecting or hovering over a node can show which region of the page it corresponds to.
- Compare the tree with the source. The DOM inspector shows the browser’s current parsed document, which can include parser repairs and JavaScript changes. View Source shows the source received from the server. They answer different questions; neither alone always explains the current page.
MDN’s HTML debugging guide recommends using the inspector to investigate the structure the browser is rendering. If the DOM differs from the source, check both malformed markup and scripts that may have changed the page after it loaded.
Validate the source and follow the diagnostics
Run the whole document through an HTML validator to find conformance problems that may not be obvious on screen. MDN describes submitting a URL, uploading a file, or entering markup directly. The W3C validators and tools page lists the Nu HTML Checker.
- Validate the page or source file that reproduces the issue.
- Read each diagnostic, including its line and column, as a location to investigate—not necessarily the exact place where the underlying mistake began.
- Inspect nearby opening and closing tags, nesting, and quoted attribute values. An earlier unclosed element can cause later diagnostics to point somewhere unexpected.
- Correct the source, run validation again, then reload and inspect the DOM and visible result.
A validator helps identify source markup problems; it does not prove that CSS styles or JavaScript behavior are correct.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minute#1 Best Overall
- HTML CSS Design and Build Web Sites
- Comes with secure packaging
- It can be a gift option
Common HTML errors and how to fix them
Unclosed elements
A missing closing tag can make later content part of an element unintentionally. For example, emphasis might continue beyond the phrase you meant to emphasize. Add the appropriate closing tag at the intended boundary, then check the affected region in the DOM.
Elements in the wrong nesting order
Nested elements must close in the reverse order in which they open. If an outer emphasis element is closed before an inner strong element, the parser may reconstruct a different tree than you expected. Compare the opening and closing tags as pairs, correct their order, and inspect the resulting DOM.
Rank #2
Malformed or unclosed attributes
Check that attribute values are quoted and that each quote has a matching partner. A missing quote can cause following text to be read as part of an attribute, which may prevent a link from being created as intended. Inspect the element in both the source and DOM after correcting the value.
Tell markup problems apart from CSS and JavaScript
If validation is clean but the page still looks wrong, do not assume HTML is the cause. Use the browser’s developer tools to inspect applied styles and script errors. MDN’s guides to common HTML and CSS problems and debugging CSS explain how to investigate those separate layers.
Rank #3
| Question | Tool to use | What it shows |
|---|---|---|
| What structure is the browser using now? | DevTools DOM inspector | The live DOM, including parser normalization and runtime changes. |
| Where are source markup problems? | HTML validator or Nu HTML Checker | Conformance diagnostics and locations to investigate. |
| Can I catch issues while editing? | Editor linter | Faster feedback in the authoring workflow; MDN notes editor-integrated linters as an option. |
| Why does styling or script behavior look wrong? | Relevant DevTools panels | Applied CSS and JavaScript errors that can resemble markup problems. |
Or skip the browser setup
If you need a screenshot of a page while documenting or checking the result, ScreenshotNeo can return an image or PDF from one API request. It is a screenshot service, not an HTML validator: use the browser and validator steps above to diagnose markup.
For a screenshot, this cURL request saves the capture as shot.webp (replace the example target URL and provide your API key):
Rank #4
- Brand: Wiley
- Set of 2 Volumes
- A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
Quick Recap
Best Value
See the ScreenshotNeo documentation for request options. Cookie banners, popups, and chat widgets are removed before the shot; bot checks, blank pages, and failed loads are never billed; and an MCP server lets AI agents take screenshots. The Free plan includes 1,000 screenshots a month with no card, and paid plans start at $5 for 3,000. Sign up for free.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




