To debug HTML, inspect the affected element in your browser’s DevTools, compare the live DOM with the original source, validate the document, then fix the markup and check the result again. A page that looks acceptable may still contain errors: browsers often repair malformed HTML while parsing it, so the rendered structure can differ from the source.
Start with the part of the page that is wrong
- Reproduce the problem. Note exactly what looks wrong and which text, link, or other element is affected.
- Inspect the element in DevTools. Open the browser’s developer tools and use the DOM or Elements panel to find the affected node. Compare its parent and child elements with the structure you intended. Selecting or hovering over a node can show which part of the page it represents.
- Compare the live DOM with the source. Use the DevTools DOM inspector to see the structure the browser currently uses. Use View Source or your HTML file to check the markup received from the server. These views can differ because the browser repairs malformed markup or JavaScript changes the page after it loads.
- Validate the document. Run the whole HTML document through a validator and use its line and column diagnostics to locate likely problems. MDN describes validating a URL, uploaded file, or pasted input in its HTML debugging guide; the W3C tools page lists the Nu HTML Checker.
- Correct the source and check again. Fix the reported markup, reload the page, and inspect the DOM and visible result. Re-run validation to confirm that the changes addressed the issue.
Why the DOM may not match your HTML
The source is the markup delivered by the server; the DOM is the tree the browser has parsed and is currently using. Browsers are designed to recover from many markup mistakes. As a result, a missing closing tag or invalid nesting can lead to a DOM tree different from the one the author expected, even when the page still displays.
The live DOM may also reflect JavaScript changes made after the page loaded. If View Source and DevTools differ, consider both parser recovery and runtime changes before deciding where the discrepancy came from. The DOM inspector is essential for diagnosing what the browser is rendering, but it is not a guaranteed copy of the original file.
Common HTML mistakes and how to fix them
Unclosed elements
A missing closing tag can cause content or formatting to continue beyond the intended point. Check the affected element and nearby elements for a missing or misplaced end tag. Use the DOM tree to identify where the browser inferred a boundary, then correct the source and validate again.
#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
Elements nested in the wrong order
Nested elements must be closed in an order that preserves their structure. For example, if an outer emphasis element is closed before an inner strong element, the browser may reconstruct the tree rather than preserve the intended nesting. Compare the source’s opening and closing tags with the parent-child relationships shown in DevTools.
Malformed or unclosed attributes
A missing quote in an attribute can cause following text to be treated as part of its value. A link or other attribute may then behave differently than expected. Check the opening tag around the affected element, make sure quoted values have matching quotes, and confirm that the rendered node has the attribute you intended.
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
Markup appears fine, but the page still looks wrong
Not every visual problem is an HTML problem. If validation is clean and the DOM structure is as intended, inspect the applied styles in DevTools and check for JavaScript errors or runtime changes. MDN’s guides to common HTML and CSS problems and debugging CSS explain how to investigate those separate causes.
Choose the tool that answers your question
| Question | Tool | What it shows |
|---|---|---|
| What structure is the browser using now? | DevTools DOM inspector | The live DOM, including browser normalization and changes made at runtime. |
| Where are my source markup problems? | HTML validator, including the Nu HTML Checker | Conformance diagnostics and locations to investigate. |
| How can I catch issues while editing? | Editor-integrated HTML linter | Feedback within the editing workflow; MDN describes editor linting as an option. |
| Is the problem actually styling or script behavior? | Relevant DevTools panels | Applied styles and JavaScript errors that can resemble markup problems. |
Or skip the browser setup
For a screenshot of a page after you have made a fix, ScreenshotNeo offers a one-request capture. It is a screenshot API and MCP server for developers. This does not replace inspecting the DOM or validating your HTML; it provides a way to capture the resulting page.
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
See the ScreenshotNeo API documentation for request details.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
- Cookie banners and consent prompts, newsletter popups, and chat widgets are removed before capture; each of these steps can be turned off.
- Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed. The response indicates the page verdict and billing status in headers.
- An MCP server provides screenshot tools for AI agents and other MCP clients.
- The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots.
Sign up for ScreenshotNeo’s free plan to get 1,000 screenshots a month without a card.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Frequently Asked Questions
Does a page displaying correctly mean its HTML is valid?
No. Browsers can recover from malformed markup, so visual rendering alone does not establish that the source is correctly authored.
Should I trust View Source or the DOM inspector?
They answer different questions: View Source shows the source received from the server, while the DOM inspector shows the browser’s current parsed document, which may also have been changed by JavaScript.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Quick Recap
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
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.

