Lesson 1: How the Web Works: Browsers, Servers and URLs
Every website you have ever visited works the same way underneath, and understanding that journey is the foundation of everything in this course. When you type an address into a browser and press Enter, your computer asks a system called DNS to turn the human-readable name, such as alpha.unb.college, into a number called an IP address, which is the real address of a computer on the internet. Your browser then sends a request to that computer, called a server, asking for a particular page. The server sends back files — mostly HTML, CSS and JavaScript — and your browser reads them and draws the page on your screen. Nothing magical happens in between, and every part of that chain is something you can learn to build.
Clients, servers and requests
The two main characters in this story are the client and the server. The client is usually your browser, and its job is to ask for things and display what comes back. The server is a computer that stays switched on, waiting for requests, and its job is to answer them by sending files or data. The conversation between them follows a set of rules called HTTP, the HyperText Transfer Protocol, which you will meet in detail in Unit 4. A request says what is wanted, for example GET the page at /courses, and the response carries the file plus a status code, such as 200 for success or 404 for not found. Because the rules are public and shared, any browser can talk to any server, which is why the web works across every device and operating system.
What a URL really says
A URL is an address with several parts, and each part has a job. Take https://alpha.unb.college/courses/lang-french/lesson-01.html as a worked example. The https part is the scheme: it tells the browser to use the secure, encrypted version of HTTP. The alpha.unb.college part is the host, the name of the server to contact. The /courses/lang-french/lesson-01.html part is the path, the location of the file on that server, like folders on your own computer. Sometimes a URL also has a query, starting with a question mark, which passes extra information, such as ?a=stats. Reading a URL this way is a practical skill: it tells you where a link will take you before you click it, and it helps you spot suspicious links that pretend to be something they are not.
What the browser does with files
When the files arrive, the browser does three jobs in order. First it reads the HTML, which describes the content and structure of the page: headings, paragraphs, links, images and forms. Then it reads the CSS, which describes how that content should look: colours, spacing, fonts and layout. Finally it runs the JavaScript, which can change the page after it loads, respond to clicks, and fetch fresh data without reloading. If any of these files is missing or broken, the page still tries its best: HTML without CSS looks plain but readable, and JavaScript that fails usually leaves the rest of the page working. That layered design is deliberate, and it is why you will learn the three languages in that order in this course.
From address bar to web page
DNS turns the name into an IP address first, so the browser knows which server to ask.
The tools you will use
You need surprisingly little to build websites: a text editor, a browser, and a folder on your computer. A good free editor is Visual Studio Code, which colours your code, catches typos and shows your files in a sidebar, but any plain-text editor works, and even the editor built into your operating system is enough to start. Your browser already has a powerful tool built in: press F12 or right-click and choose Inspect, and you can see the HTML, CSS and JavaScript of any page, change values live, and watch network requests arrive. Professional developers use that inspector every day, and you will use it constantly in this course to experiment, debug and learn from real sites. Save your work in one project folder per site, keep file names lowercase with no spaces, and you are ready for Lesson 2.
Key Terms
- Browser (client)
- The program that requests web pages and displays them, such as Firefox, Chrome or Safari.
- Server
- A computer that stays online to answer requests by sending files or data.
- DNS
- The Domain Name System, which turns a human-readable name like alpha.unb.college into an IP address.
- IP address
- A number that identifies a computer on a network, used as its real address.
- HTTP
- HyperText Transfer Protocol, the shared rules browsers and servers use to talk to each other.
- URL
- Uniform Resource Locator, the address of a page, made of a scheme, a host and a path.
- Status code
- A number in a server response that says what happened, such as 200 for success or 404 for not found.
Discussion Questions
- Why do you think the web was designed so that any browser can talk to any server, instead of each company inventing its own system?
- When you click a link, which parts of the journey happen on your computer and which happen somewhere else?
- If a page loads but looks completely unstyled, which file is most likely missing, and why can you still read the page?
Practice Questions
- What does DNS do when you type a web address?
- In the URL https://alpha.unb.college/courses/, which part is the host?
- What is the difference between a client and a server?
- What does the status code 404 mean?
- Name the three files a browser uses to show a page, and what each one does.
Show answers
- It turns the name into an IP address. The browser needs the server's numeric address before it can send a request, and DNS provides that translation.
- alpha.unb.college is the host. The https part is the scheme and /courses/ is the path to the page on that server.
- The client asks for things and displays them; the server answers requests. Your browser is the client, and the computer hosting the site is the server.
- It means the requested page was not found on the server. The server answered, but it has no file at the path that was asked for.
- HTML describes content and structure, CSS describes how it looks, and JavaScript adds behaviour. The browser reads them in that order and draws the page from them.