HTML How the Web Works
URLs, DNS, HTTP, browsers, servers — the round-trip behind every web page in 60 seconds.
When you type a URL and hit Enter, eight things happen in under a second:
- You type
https://codekilla.com. - DNS lookup — your computer asks "what IP is
codekilla.com?" and gets back203.0.113.42. - TCP + TLS handshake — a secure connection opens to that IP on port 443.
- HTTP request — your browser sends
GET / HTTP/1.1. - Server responds with HTML text + status
200 OK. - Parser builds the DOM — the browser reads the HTML top-to-bottom.
- Sub-resources fetch — CSS, JS, images, fonts each trigger their own request.
- Render — paint the screen, run JS, fire
DOMContentLoadedthenloadevents.
[Browser] --GET--> [DNS] --IP--> [Server (HTML/CSS/JS)] --200--> [Browser]
Step 1. Open Chrome DevTools (F12) → Network tab.
Step 2. Visit any site (e.g. https://example.com).
Step 3. Inspect the very first row:
- Method: GET
- Status: 200
- Type: document
- Initiator: navigation
- Time: ~50–500 ms
The HTML doc is always the first request. Everything else (CSS, JS, images) is triggered by parsing it.
| Side | Runs on | Speaks | Examples |
|---|---|---|---|
| Client | User's device (browser) | HTML, CSS, JS | Chrome, Firefox, Safari |
| Server | Datacenter | HTTP, often Node/Python/Go | Codekilla.com, Google.com |
The browser only speaks HTTP(S). A Python or Java backend listens on a port and responds with HTML strings.
- Static page — HTML files sit on the server unchanged. Cheap, fast (CDN-cached). Examples: docs, blogs.
- Dynamic page — server runs code per request, builds HTML on the fly. Examples: Twitter feed, dashboards.
- Confusing "deploy" with "publish" — deploy = upload to server; publish = make it reachable on the internet.
- Thinking JS runs on the server by default — in the browser it's client-side. Node.js gives you JS on the server.
- Forgetting HTTPS —
http://is plain text; usehttps://for everything in production.
- Trace a request — Open DevTools → Network → reload
example.comand screenshot the waterfall. Hint: the first row is the document. - Find your IP — Run
ping codekilla.comin a terminal. The IP shown is what DNS resolved. Hint: requires internet. - Status hunting — Visit a non-existent page (
example.com/foo) and read the status code. Hint: 404.
💡 Think Like a Programmer: Every web app, no matter how complex, is just HTTP requests + HTML responses. Once that clicks, debugging gets infinitely easier.
Quick recap quiz?
We'll generate 5 MCQs from this lesson and check your understanding instantly. Takes ~30 seconds.
