Make Your First Page
Create LearningShelf's first HTML page and learn how document structure becomes browser content. Start with meaningful headings and resource links before adding styling or behavior.
What You Will Learn
- Describe the different jobs of HTML, CSS and JavaScript.
- Create a complete HTML document with meaningful headings and links.
- Connect a local file change to an observable browser result.
Understand the Idea
A web page begins as a text file. The browser reads HTML and builds a document containing elements such as headings, paragraphs and links. An element has meaning: an h1 names the page's main topic, while an anchor with an href provides navigation. Choose elements for those jobs rather than for the size or color they happen to display.
Every LearningShelf page will have a head and a body. The head contains information about the document, including its title, character encoding and mobile viewport. The body contains the material a visitor reads and operates. Indentation helps you see which elements belong inside other elements; it does not create the nesting. Matching opening and closing tags does.
Start with content before visual polish. LearningShelf is a directory of resources you want to revisit. A visitor should be able to tell what it contains, read a resource name and follow its link. Make link text describe the destination instead of repeating 'click here'. Organize related content beneath headings so the structure remains understandable even without styling.
Save the file as index.html, not index.html.txt, and open it in a browser. At this stage a file address is sufficient because there is no data fetching or persistent browser state. Keep the editor and browser side by side: change one sentence, save, reload and check the result. Later lessons introduce a local server when the application needs an HTTP origin.
WORKED EXAMPLE
A Complete First Document
Create index.html in an empty LearningShelf folder. This example has no dependencies and can be opened directly in a modern browser. The resource links require internet only when you follow them.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>LearningShelf - My Resource Library</title>
</head>
<body>
<header><h1>LearningShelf</h1><p>A small library for learning the web.</p></header>
<main>
<h2>My Resources</h2>
<ul id="resource-list">
<li><a href="https://developer.mozilla.org/en-US/curriculum/">MDN Curriculum</a><p>Start with web foundations.</p></li>
<li><a href="https://www.theodinproject.com/">The Odin Project</a><p>Learn by building projects.</p></li>
<li><a href="https://portswigger.net/web-security">Web Security Academy</a><p>Study web security in provided labs.</p></li>
</ul>
</main>
<footer><p>Built while learning HTML.</p></footer>
</body>
</html>- The language and encoding describe how the document should be interpreted.
- The title names the browser tab; h1 is the heading inside the page.
- The list groups resources, and each anchor names its own destination.
Expected Result
The browser shows a heading, three resource links with descriptions, and a footer. Tab moves through the links in document order.
PROJECT STAGE 01 / 10
Create the LearningShelf Skeleton
Builds on: A new empty project folder; no previous code is required.
- Create a folder named LearningShelf and an index.html file. Copy the example, save it, and open that exact file in your browser.
- Replace the introductory sentence with your own learning goal. Keep one h1 and add a second h2 section explaining who the collection is for.
- Add a locally created image named shelf.png only after the file exists. Give it alternative text describing useful information, or empty alt text if it is purely decorative.
- Use Tab and Enter to visit each link. Check the browser tab title and compare the heading order with the source.
- Create notes.md with three observations: an edit you predicted correctly, a mistake you corrected, and a question for the next lesson.
Keep This Deliverable
index.html, optional shelf.png, and notes.md containing a working first page and your observations.
Check Your Build
- All three links have meaningful names and correct destinations.
- You can identify the head, body and main heading in your file.
- Reloading shows your latest saved sentence.
Common Mistakes and Fixes
- The browser displays an older version of the page.
- Check that the editor saved the same file whose path appears in the browser address bar.
- An image shows a broken placeholder.
- Check the filename, extension and relative path; do not add an image reference before creating its file.
Check Your Understanding
Why does changing the title element not change the large heading inside the page?
Reveal the explanation
The title is document metadata used for places such as the browser tab. The visible heading is separate body content, represented here by h1. Change each element according to its purpose.
Ready to Move On?
Explain the document structure, follow every link with the keyboard and show a saved edit after reload.
Open the learning resource
