LESSON 2
How Websites Work
Learning objective: Learn what happens between typing a URL and seeing a web page.
Understand
Before writing more HTML, it helps to know how a page actually reaches your screen.
When you enter a URL, your browser (the client) sends a request to a server. The server responds with files — HTML, CSS, JavaScript, images. The browser then reads the HTML, applies the CSS, runs the JavaScript, and paints the page. This request-and-response cycle is the foundation of the web.
Analogy: It is like ordering at a restaurant: you (the browser) ask the kitchen (the server) for a dish, and it sends back a finished plate (the page).
See It in Action
A simplified view of the flow looks like this:
You type a URL -> Browser requests it -> Server responds with files
Browser reads HTML -> applies CSS -> runs JavaScript -> shows pageTry It Yourself
- Open any website and right-click, then choose 'View Page Source'.
- Find one
<h1>or<p>tag in the source. - Notice that the page you see is built from that HTML text.
Quick Quiz
In the web request cycle, what does the server do?
Challenge
In one sentence each, describe the job of the browser and the job of the server.
Success condition: You can explain, in your own words, how a page travels from server to screen.
Lesson Complete
You answered correctly and completed the required practice. Your progress has been saved on this device.
Continue to next lesson →