Web Development Pro | Lesson 001 | How the Web Delivers a Page
Web Development Pro · Lesson 01 of 60
Module 1: HTML foundations
In this lesson
Prerequisites and learning outcomes
No coding experience is required. You need a text editor, a browser, and a disposable practice folder. By the end, you can trace a local page and distinguish HTML, CSS, and JavaScript. Plan 10–15 minutes for the core explanation and additional time for the worked practice.
A page is a collection of cooperating parts
A neighborhood group wants a page advertising a free repair workshop. Before choosing colors or writing a program, identify what the browser needs: a document describing the workshop, optional styling, and optional behavior. HTML gives content structure and meaning. CSS controls presentation. JavaScript can respond to actions or update content. A useful page can begin with HTML alone. Starting there gives you something readable even before the visual layer is ready.
A website is not a picture of a page. It is a set of resources interpreted by software. The browser downloads or opens resources, parses them, constructs an internal document tree, calculates layout, and paints pixels. Assistive technologies can also use the resulting semantics. Two browsers may draw slightly different default buttons while understanding the same button element. Your job is to describe the right thing, then test whether people can use it.
Follow one request
For a public URL such as https://example.org/events/repair.html, https identifies a protocol, example.org identifies a host, and /events/repair.html identifies a path. The browser normally resolves the host through DNS, establishes a connection, and sends an HTTP request. A server sends a response with a status, headers, and usually a body. These steps are a simplified model; caches and existing connections can avoid some work.
A successful document response does not guarantee a successful page. The HTML may refer to a missing stylesheet or image, producing additional failed requests. A 404 means the requested resource was not found at that address. A 200 response indicates success at the HTTP layer, but its contents can still be wrong. Later lessons use the Network panel to inspect this distinction rather than guessing from a blank screen.
Your first example uses a local file instead of a public server. A file URL asks the browser to read a file you already have. That is enough for basic HTML and CSS, but browser security rules make some features, including module loading and many data requests, unsuitable for direct file opening. When those lessons arrive, use an already available local HTTP server. Nothing in this course requires buying hosting or creating an account.
Make the smallest complete page
Create a folder named workshop-site. Save the following as index.html, ensuring the editor does not append .txt. Open it in your browser. This is a complete document, not a fragment to paste into the browser console.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Repair Workshop</title>
</head>
<body>
<main>
<h1>Repair Workshop</h1>
<p>Bring a broken everyday item and learn a repair skill.</p>
</main>
</body>
</html>
The opening and closing tags surround content. Some elements, such as meta, have no closing tag. Attribute values add information to an element: lang="en" declares the document language. The head contains document metadata; the body contains the content people encounter. The viewport declaration helps mobile browsers use the device width as the layout viewport. It does not make a poorly designed layout responsive by itself.
Change the paragraph, save, and reload. The editor changes the file; reload asks the browser to read it again. Editing the browser's inspected DOM changes the current document, not automatically your source file. This difference explains why an experiment in developer tools can vanish after refresh. Keep durable work in files and use browser inspection to learn what those files produced.
Build a habit of checking evidence
Use the browser's View Source or developer tools to locate the h1. The source is the document text; the Elements or Inspector panel shows the browser's current document tree. The browser may repair malformed markup, and scripts may modify the tree later, so these views are related rather than interchangeable. An attractive result alone is not proof of correct structure.
Keep fictional public information in these exercises. Do not paste passwords, attendee contact lists, or private workplace data into sample files. A local file can become public if copied into a hosting folder later. Starting with harmless practice content avoids creating a hidden privacy problem while you learn deployment.
Worked practice
Worked exercise 1: Separate responsibilities
Task: The workshop title must become “Repair Together,” its background must become blue, and a button must reveal extra details. Which technology owns each initial change? Worked answer: change the title text in HTML, use CSS for the background, and use JavaScript for custom reveal behavior when native HTML is insufficient. The content should still explain the workshop without that custom behavior.
Worked exercise 2: Diagnose a missing edit
Task: You changed a sentence in the Inspector, refreshed, and lost it. Worked answer: the inspection edit affected the in-memory document only. Open index.html in the editor, make the same change, save, then reload. Verify the new sentence in both source and rendered content. This checks the actual saved artifact rather than a temporary preview.
Worked exercise 3: Read a URL
Task: Identify the host and path in https://example.org/classes/bikes.html. Worked answer: the host is example.org and the path is /classes/bikes.html. “https” is the scheme. Changing the path requests a different resource on the same host; it does not automatically rename a local file or create a new page.
Knowledge check
Question 1
Which language primarily describes document structure? A) CSS. B) HTML. C) JavaScript. D) HTTP.
Check question 1: answer and explanation
Answer: B. HTML marks headings, paragraphs, and other content roles; CSS describes presentation.
Question 2
What does reloading after saving usually do? A) Copies the local edit to a public server. B) Saves any unsaved changes in the text editor. C) Reads the updated resource again. D) Saves Inspector changes back to the source file.
Check question 2: answer and explanation
Answer: C. Saving and loading are separate steps; neither alone publishes a local page.
Question 3
Which part of the sample URL identifies the host? A) https. B) /classes/. C) bikes.html. D) example.org.
Check question 3: answer and explanation
Answer: D. The host identifies the network destination; the path selects a resource there.
Question 4
Can an HTTP 200 page still have a broken image? A) Yes. B) No, because the document status applies to all its resources. C) Only when the image is hosted on a different origin. D) Only when JavaScript creates the image element.
Check question 4: answer and explanation
Answer: A. The document and image can be separate requests with different outcomes.
Question 5
Where should a permanent text change be saved? A) Only in the Inspector. B) In the source file. C) Only in the browser’s live document tree. D) Only in a screenshot of the changed page.
Check question 5: answer and explanation
Answer: B. A source edit survives reload; a temporary DOM edit generally does not.