Course topics

By WebNest Studio Engineering Team

HTML Tutorial

Setting Up Your Editor and Browser DevTools

Before you write a single tag, it pays to spend ten minutes setting up the two tools you will use in every HTML lesson from here on: a code editor and your browser's built-in DevTools. A good setup turns "edit, save, alt-tab, refresh, look" into a fast, almost invisible loop, which matters enormously when you are learning by trial and error.

This lesson does not assume any prior tooling experience. It walks through installing an editor, adding one extension that removes the need to manually refresh your browser, and opening the DevTools panel that lets you inspect and debug the page you just built.

Why it matters

Every web developer spends the day in two tools: an editor and the browser's DevTools. DevTools shows the page as the browser actually built it, the styles that apply to an element, and the errors your script raised. Learning to open the Console and the Elements panel now saves hours of guessing later.

Choosing and Configuring an Editor

Visual Studio Code (VS Code) is the de facto standard code editor for web development: it is free, cross-platform, has excellent HTML/CSS/JavaScript support out of the box, and has a massive extension ecosystem. Install it, then add the "Live Server" extension.

  • Download VS Code from the official site and install it for your operating system.
  • Open the Extensions panel (the square-icon sidebar) and search for "Live Server" by Ritwick Dey — install it.
  • Open a folder (not just a single file) in VS Code so relative links between your HTML, CSS, and image files resolve correctly.
  • Right-click any .html file in the editor and choose "Open with Live Server" to launch it in your default browser on a local address like http://127.0.0.1:5500.

The Edit-Save-Refresh Workflow

With Live Server running, the workflow becomes: edit your HTML file, save it (Ctrl+S / Cmd+S), and the browser tab reloads automatically to show your change — no manual refresh needed. This tight feedback loop is what makes learning HTML by experimentation practical instead of tedious. Without Live Server you would need to double-click the HTML file to open it as a plain file:// URL and manually refresh after every change, which still works for very simple pages but breaks down once you add features that expect a real server (like fetch requests).

Opening and Using Browser DevTools

Every modern browser (Chrome, Firefox, Edge, Safari) ships with a DevTools panel. Open it with F12 or Ctrl+Shift+I (Cmd+Option+I on Mac), or by right-clicking any element on the page and choosing "Inspect."

  • Elements tab — shows the live DOM tree and the exact CSS applied to whatever element you select; you can edit HTML/CSS here temporarily to experiment without touching your files.
  • Console tab — shows errors (like a broken image path or a JavaScript exception) and lets you run JavaScript directly against the loaded page.
  • Network tab — shows every file the page requested (HTML, CSS, images, scripts) along with status codes, so you can immediately spot a 404 for a mistyped filename.

Examples

A minimal page to test your Live Server + DevTools setup

HTML
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Setup Check</title>
</head>
<body>
  <h1 id="greeting">Hello, Webnest!</h1>
  <p>If Live Server is working, editing this text and saving should refresh the page automatically.</p>
</body>
</html>
Output
The browser opens a page showing a heading "Hello, Webnest!" followed by a paragraph. Editing the heading text and saving the file causes the browser tab to reload automatically within about a second, without you switching windows or pressing refresh.

Using the Console tab to confirm the page is inspectable

HTML
// Typed directly into the DevTools Console tab, not saved in a file
document.getElementById('greeting').style.color = 'crimson';
Output
The heading text "Hello, Webnest!" immediately turns crimson red in the rendered page, and the Console echoes the string "crimson" as the return value of the assignment — confirming DevTools has live access to the page.

Common Mistakes

  • Opening a single HTML file directly by double-clicking it (a file:// URL) and then wondering why Live Server's auto-refresh is not working — Live Server requires opening a folder as a VS Code workspace and launching from within the editor.
  • Editing styles directly in the Elements tab and expecting the change to persist — DevTools edits are temporary and disappear on refresh; you must copy real changes back into your CSS file.
  • Never checking the Network tab and being confused when an image does not appear — a quick look at Network usually reveals a 404 caused by a typo in the file path.
  • Ignoring red error messages in the Console tab, which almost always point directly at the line and file causing a problem.

Exercise

The script should change the heading to DevTools works, but nothing happens. Run the page, open the Console in DevTools (or the playground's console) and read the error. Then fix the one mistake in the markup.

Expected result: the heading on the page reads DevTools works.

HTML · starter code
<h1 id="tittle">Hello</h1>

<script>
  document.getElementById("title").textContent = "DevTools works";
</script>
Show hints
  • The error says that a property cannot be set on null, which means getElementById found nothing.
  • Compare the id the script looks for with the id written on the heading.
Show solution
HTML · solution
<h1 id="title">Hello</h1>

<script>
  document.getElementById("title").textContent = "DevTools works";
</script>

Quick quiz

1. Which DevTools panel shows the HTML of the page as the browser currently has it?

  • A. Elements
  • B. Network
  • C. Console
  • D. Application
Show answer

A. The Elements panel shows the live DOM, including changes made by scripts.

2. Where do JavaScript errors and console.log messages appear?

  • A. The Elements panel
  • B. The Console panel
  • C. The Sources panel only
  • D. The address bar
Show answer

B. The Console lists messages and errors, with the file and line they came from.

3. What does an extension such as Live Server do?

  • A. Publishes the site to the internet
  • B. Checks the HTML for errors
  • C. Serves the files locally and reloads the page when a file is saved
  • D. Compresses images
Show answer

C. It removes the need to refresh the browser by hand after each change.

Interview questions

How do you use browser DevTools when a page does not look or behave as expected?

Show answer

Check the Console first for errors. Use the Elements panel to inspect the element: confirm that the markup is what you expect and look at the Styles pane to see which CSS rules apply and which are crossed out. The Network panel shows whether files and API requests loaded and with what status. For script problems, set a breakpoint in the Sources panel and step through the code.

What is the difference between "View page source" and the Elements panel?

Show answer

View page source shows the HTML text exactly as the server sent it. The Elements panel shows the DOM, the tree the browser built from that text, after it has corrected invalid markup and after JavaScript has added, removed or changed elements. On a page built by a framework the two can be very different.

Key Points to Remember

  • VS Code plus the Live Server extension gives you automatic browser refresh on save, which is the standard beginner workflow.
  • Open DevTools with F12 or right-click → Inspect; the Elements, Console, and Network tabs cover most day-to-day debugging needs.
  • Elements tab edits are temporary and exist only in the browser session — always make the real change in your source file.
  • The Network tab is the fastest way to diagnose missing files, broken links, and failed requests.

Practice in the playground

Write and run your own code for this topic, or start from the exercise or an example. Shows a live preview of your HTML, CSS and JavaScript. Your code for each topic is kept in this browser.

Run the examples

Change an input, predict the result, then compare it with the output. Explain why the result changes.

WebNest Studio

Written by

WebNest Studio Engineering Team

Practical lessons from developers working with Java, Python, React, databases and production systems.

Led by Vansh Duggal, Founder, WebNest Studio · Full-stack & software engineering