4. Interactive Apps, Storage & APIs

Browser DevTools Debugging & Publishing Live

Inspect elements, debug JavaScript in the Console and Network tabs, and deploy your finished website free to the internet on GitHub Pages or Vercel.

3 min readUpdated 2026-11-29
In This Lesson
  • Inspect layout, Console logs, and Network requests in Browser DevTools
  • Test mobile screen sizes directly inside DevTools Device Toolbar
  • Publish a finished static site online for free with GitHub Pages or Vercel

Building a page on your laptop feels great—and two practical habits bridge the gap between a local class exercise and a real shipped product: diagnosing bugs systematically in Browser DevTools and deploying your site live so anyone on earth can open your URL.

Debugging Layout & Code in Browser DevTools

Every modern browser ships with a complete inspection laboratory built right in. Right-click anywhere on a webpage and choose Inspect (or press Cmd + Option + I on Mac / F12 on Windows) to open DevTools. Four tabs handle 95% of daily debugging:

  1. Elements Tab: Hover over HTML tags to highlight exact dimensions on screen, inspect computed padding and margin in the visual Box Model panel, and toggle CSS checkboxes temporarily without touching your source code.
  2. Device Toolbar (Phone/Tablet Icon): Resize your page to a 375px mobile screen with one click so you immediately spot horizontal overflow or cramped buttons before your users do.
  3. Console Tab: Displays red JavaScript runtime errors with clickable line numbers, and lets you log structured arrays or objects with console.log() or console.warn().
  4. Network Tab: Records every image, stylesheet, and fetch() API call alongside its HTTP status (200 OK, 404 Not Found, or 500 Server Error) and raw JSON payload.
Debugging Slow or Broken API Calls

Whenever a button click seems to do nothing, open the Network tab before clicking again. You will immediately see whether no request fired at all (JavaScript listener bug) or the server returned 404 / 500 (backend URL or payload bug).

Try Structured Debugging Logs Live

Good debug logs label what you are printing and filter straight to suspicious items instead of dumping noisy text. Run this example to see clear logging in action:

JavaScriptDebugging Tip: console.log & Error Inspection
Output

Click “Run Code” to execute this snippet right in your browser.

Publishing Your Website Live for Free

Once your HTML, CSS, and JavaScript work cleanly locally, sharing them with the world takes under five minutes and costs $0:

Option A: GitHub Pages (Ideal for Static Sites)

  1. Push your folder (index.html, style.css, app.js) to a GitHub repository.
  2. Open Repository → Settings → Pages in your browser.
  3. Under Source, choose Deploy from a branch, select main and / (root), and click Save.
  4. Wait ~60 seconds, refresh, and your permanent public link (https://username.github.io/repo-name) is live with free HTTPS!

Option B: Vercel or Netlify (Best for Dynamic & Framework Apps)

Sign in with your GitHub account on Vercel or Netlify, import your repository, and click Deploy. Every time you run git push in the future, they automatically rebuild and publish your latest update to a fast global CDN—still completely free for personal and portfolio sites.

Final Launch Verification

DevTools & Deployment Checklist

0/4 done

Quick Checkpoints

Check Your Understanding

Which DevTools tab lets you see whether a fetch() API call returned HTTP 200 or 404?