Browser DevTools let you look at the live page the browser built from your HTML, change it on the fly and see the result immediately. Right-click any element and choose Inspect (or press F12, or Ctrl+Shift+I, or Cmd+Option+I on macOS) to open the Elements panel and see the page structure. This is the fastest way to find out why a page looks the way it does, which is why searches for "inspect element html devtools" are so common.
Every modern browser (Chrome, Edge, Firefox, Safari) ships DevTools with the same core ideas, so the skills below transfer between them.
There are three common ways to open DevTools:
F12, or Ctrl+Shift+I on Windows and Linux, or Cmd+Option+I on macOS.The panel you want for HTML is called Elements in Chrome and Edge, and Inspector in Firefox. It shows the page as a tree. Clicking a node highlights the matching part of the page, and hovering over a node does the same. You can also press the small arrow icon at the top-left of DevTools and then click anything on the page to jump to its node.
The tree you see in the Elements panel is the DOM, not your original file. The browser parses your HTML, repairs mistakes, and then JavaScript may add, remove or change nodes. That is why DevTools can show something different from View Source.
| Tool | What it shows | When to use it |
|---|---|---|
View Source (Ctrl+U) | The exact text the server sent | Check what the server returned, before any script ran |
| Elements panel | The current DOM, after parsing and scripts | Debug what the browser actually renders |
Here is a small file to try this with:
In View Source you will see the <li>Two without a closing tag and no extra paragraph. In the Elements panel the second <li> is closed for you and the paragraph "Added by JavaScript" appears at the end of <body>. The browser fixed the markup and ran the script, and DevTools shows the result.
You can change the page directly in the Elements panel:
Delete with a node selected to remove it.Try changing the <h1> text to something else and the page updates at once. Right-click the <ul> and choose Edit as HTML to add a third <li>.
These edits live only in your browser's memory. Reloading the page throws them away, and nothing is saved to your file or to the server. That makes DevTools a safe place to experiment: you can try a heading change, a different attribute or a deleted section without risk. Once you are happy with a change, copy it into your real source file.
Selecting an element also shows its styling. In Chrome and Edge the Styles pane sits beside the Elements tree. In Firefox it is the Rules pane. It lists every CSS rule that applies to the element, from the most specific down, and crossed-out lines are rules that lost to a more specific one.
Useful things to do in this pane:
:hov) to force :hover, :focus or :active.You can also check attributes. Click an <img> and look at its src, alt, width and height. Click a link and confirm its href. If something does not work, a misspelt attribute name is often visible right there in the tree.
The Elements panel is not the only useful tab for HTML work. Two others come up often:
200 or a failure such as 404 Not Found.A broken image is a common beginner case. If an <img src="photos/cat.jpg"> shows a broken icon, check the Network panel for a 404 and compare the requested URL with the real file location. The usual fault is a wrong folder name or letter case.
You can also test device sizes. Click the device toolbar icon (Toggle device toolbar) to resize the viewport to phone and tablet widths and check how your HTML behaves on small screens.
Yes. Inspect only changes the copy of the page in your own browser, and the edits disappear when you reload. It does not change the real website or its server.
View Source shows the original response from the server. The Elements panel shows the live DOM after the browser has fixed errors and JavaScript has modified the page.
DevTools does not save edits to your file. Copy the changed markup from the Elements panel, using Copy, then Copy outerHTML, and paste it into your editor. Chrome also offers Workspaces for mapping files, but copying is simpler while you are learning.
Yes. You can emulate a phone with the device toolbar, or connect a real Android or iOS device to your computer and inspect it remotely from desktop Chrome, Edge or Safari.
DevTools show the live DOM your browser built from your HTML. Open them with F12 or by right-clicking and choosing Inspect, use the Elements panel to read and edit nodes and CSS, and use Console and Network to find errors and missing files. Edits are temporary, so copy anything useful back into your source file. Inspecting real pages is one of the best habits to build while learning HTML.