Your First Webpage: What HTML Actually Is
What a webpage actually is, how HTML tags work like shipping labels, and how to build a real page in your browser from scratch.
You'll learn what a webpage actually is under the hood, how HTML tags label text for your browser, and how to build a real page with headings, links, images, and lists. All you need is a web browser and any plain text editor—no coding experience required.
1. A webpage is just a text file with labels
A website is not a mysterious binary program. It is a plain text file—just like a grocery list—saved with .html at the end instead of .txt. Create a file called index.html, double-click it, and your browser reads it from top to bottom and draws it on screen.
If you put raw text in index.html with no labels:
Gerald's Status Page
I am out of the office and out of patience.Your browser smashes both lines onto one: Gerald's Status Page I am out of the office and out of patience. It ignores your Enter key because you never told it what those sentences are.
HTML (HyperText Markup Language) fixes that. You wrap words in tags—like putting shipping labels on moving boxes so the movers know which box goes in the kitchen and which one holds your regrets.
<h1>Gerald's Status Page</h1>
<p>I am out of the office and out of patience.</p>Save and refresh (Ctrl+R or Cmd+R). Now Gerald's Status Page is a big bold heading (<h1>), and the second line is a separate paragraph (<p>).
2. Opening tags, closing tags, and silent traps
Most tags come in pairs: an opening tag (<p>), your content, and a closing tag (</p>). The / means "this label ends here." Together, all three parts are called an element.
If you forget the closing slash:
<h1>Urgent Notice
<p>Everything is fine.</p>The browser won't show you an error. Browsers are built by tired engineers to never crash on bad HTML, so they silently guess what you meant—often turning half your page giant and bold by accident.
Save index.html with an <h1> and a <p>, open it in your browser, then delete </h1> and refresh to see how the browser guesses. Put </h1> back when you're done.
3. The standard page skeleton
Real webpages wrap everything in two sections: <head> (invisible info about the page, like the browser tab title) and <body> (everything the visitor actually sees).
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Gerald's Status Page</title>
</head>
<body>
<h1>Gerald's Status Page</h1>
<p>Still out of the office. Still out of patience.</p>
</body>
</html><!doctype html> just tells the browser "use modern HTML, not 1997 mode." The indentation is ignored by the browser—it's purely for humans so you can see what lives inside what.
4. Headings, links, images, and lists
- Headings (
<h1>–<h6>): Use<h1>once for the main title, then<h2>,<h3>for sections. Don't pick<h4>just because<h2>looks "too big"—screen readers use headings as a table of contents. - Links (
<a>): Pass the destination inside the opening tag using an attribute (href="..."):
<a href="https://developer.mozilla.org">Read MDN Docs</a>- Images (
<img>): Images don't wrap text, so<img>has no closing tag. Always includealtso broken images or screen readers still have a description:
<img src="cat.jpg" alt="A deeply judgmental orange cat" width="300" />- Lists (
<ul>/<ol>): Bullet points (<ul>) or numbered steps (<ol>), with each item wrapped in<li>:
<ul>
<li>Inbox count: 412</li>
<li>Willingness to hop on a "quick call": 0%</li>
</ul>Add a link and a <ul> list to index.html, save, and refresh your browser to see them render.
Common mistakes
| Mistake | What happens | Fix |
|---|---|---|
Saved as index.html.txt | Browser prints your raw <p> tags as text | Rename the file to end in .html |
Link has no https:// (href="google.com") | Browser looks for a local file named google.com | Include https:// for external links |
| Broken image icon | src filename doesn't match or is in another folder | Check exact spelling and relative path |
Forgot </tag> | Styles bleed into the rest of the page | Close every non-void tag with </tagname> |
Practice
Predict what happens before testing:
- What does
<p>Line onefollowed byLine two</p>on a new line display as? - What's wrong with
<a href=https://codeheart.tech>Click me<a>?
Answers:
Line one Line twoon a single line—HTML collapses newlines into one space. Use two<p>tags for two paragraphs.- Put quotes around the URL (
href="https://codeheart.tech") and add the slash to the closing tag (</a>).
What you learned
- A webpage is a plain
.htmltext file read top-to-bottom by a browser. - Tags label what content is; forgetting a closing
/makes the browser guess silently. <head>holds page metadata;<body>holds everything visible on screen.- Attributes (
href,src,alt) pass extra info inside the opening tag.
Next up: making your page not look like a 1995 tax form with CSS.