HTML essentialsGetting Started
How the web works: browsers, HTTP & URLs
5 min lesson
- The web is a network of computers that exchange files using a set of rules called HTTP (HyperText Transfer Protocol).
- A browser is a program that asks a server for a page, receives the files and draws the result on your screen.
- A URL (Uniform Resource Locator) is the address of a resource, like https://example.com/about.html.
- The URL has parts: scheme (https), host (example.com), path (/about.html) and sometimes a query (?id=3).
- HTTP works as a request and response: the browser sends a request, the server sends back a status code and content.
- Common status codes are 200 (OK), 404 (not found) and 500 (server error).
- This lesson builds on Introduction to HTML and prepares you for Setup & your first page, where you will run your own page.
- You will see how typing an address turns into a page on screen, step by step.
Keep in mind
- A browser asks, a server answers, and HTTP is the language they use.
- A URL is an address with parts; read it from left to right to understand it.
- Status codes tell you what happened: 200 is fine, 404 means missing.
- Keep this picture in mind; every page you build will travel this path.
URL parts
| Part | Example | Meaning |
|---|---|---|
| Scheme | https | The rules used to talk to the server |
| Host | example.com | The computer that stores the page |
| Path | /about.html | The file you want on that computer |
| Query | ?id=3 | Extra details sent to the server |
A helpful analogy
Think of a restaurant. You (the browser) give an order (the request) to the waiter (HTTP). The kitchen (the server) prepares the food (the page). The waiter brings it back, and sometimes says "sorry, we are out of that" (a 404).
Common mistakes
Confusing a URL with a file path on your own computer
Avoid
C:\Users\me\page.htmlUse instead
https://example.com/page.htmlA URL points to a server on the network; a local path points to a file on your disk. The browser treats them differently.
Quick tips
- •Open your browser's developer tools and look at the Network tab to watch requests and status codes live.
- •Type a wrong path on purpose to see a 404 response; it teaches you how servers answer.