1. What is HTML?
HTML stands for HyperText Markup Language. It is not a programming language — it's a markup language. That means its job is to describe the structure of content on a web page.
Think of it this way:
- If a web page were a building, HTML would be the skeleton — the walls, floors, and rooms.
- CSS would be the paint, furniture, and decoration.
- JavaScript would be the electricity — making things interactive.
Every single website you've ever visited — Google, YouTube, Amazon — is built on HTML at its core. Source: MDN Web Docs
Key Insight
HTML uses tags to mark up content. Tags tell the browser: "This is a heading," "This is a paragraph," "This is a link." The browser reads these tags and renders the page accordingly.
2. Anatomy of an HTML Element
An HTML element is made of three parts:
<p>Hello, World!</p>
| Part | What It Is | Example |
|---|---|---|
| Opening tag | Tells the browser "start this element" | <p> |
| Content | The actual text or nested elements | Hello, World! |
| Closing tag | Tells the browser "end this element" | </p> |
Some elements are self-closing — they don't have content or a closing tag:
<br> <!-- Line break -->
<img src="photo.jpg"> <!-- Image -->
<hr> <!-- Horizontal rule -->
3. The HTML Document Structure
Every HTML page follows this exact blueprint. This is non-negotiable — miss any piece and the browser has to guess what you meant. Source: MDN
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My First Page</title>
</head>
<body>
<h1>Hello, World!</h1>
<p>This is my first web page.</p>
</body>
</html>
Let's break down each line:
Line-by-Line Breakdown
lang="en" tells the browser the page is in English.<h1> is a top-level heading. <p> is a paragraph. These are the most basic content elements.<head> is for the browser and search engines. The <body> is for the user. If you can see it on screen, it's in the <body>.
4. Common HTML Tags You'll Use Constantly
| Tag | Purpose | Example |
|---|---|---|
<h1> to <h6> |
Headings (h1 = biggest, h6 = smallest) | <h2>About Me</h2> |
<p> |
Paragraph of text | <p>I love coding.</p> |
<a> |
Link (anchor) | <a href="https://google.com">Google</a> |
<img> |
Image (self-closing) | <img src="pic.jpg" alt="A photo"> |
<ul> / <ol> |
Unordered / Ordered list | <ul><li>Item</li></ul> |
<div> |
Generic container (no meaning) | <div>...content...</div> |
<span> |
Inline container (no meaning) | <span>highlight</span> |
<strong> |
Bold / important text | <strong>Warning!</strong> |
<em> |
Italic / emphasized text | <em>really</em> cool |
You don't need to memorize all of these now. They'll become second nature as you build. See the HTML Essential Tags Reference for a printable cheat sheet.
Interactive Practice Zone
Test your understanding of the HTML document structure. No guessing — if you're not sure, scroll up and re-read the lesson first.
Quiz Completed!
Retaking this quiz after a break builds long-term memory (storage strength), not just in-the-moment recall.
5. Code Exercise: Fill in the Blanks
Complete the missing parts of this HTML document structure. Type your answers in the blank fields.
6. Build Challenge: Your First Real Page
Theory without practice is wasted time. Do this right now:
- Open VS Code (or any text editor).
- Create a new file called
index.html. - Type the full HTML structure from memory (don't copy-paste — typing forces your brain to recall).
- Inside the
<body>, write:- An
<h1>with your name - A
<p>saying what you want to build - A
<ul>with 3 technologies you want to learn
- An
- Save the file. Double-click it to open in your browser.
- Congratulations — you just built a web page.
Primary Source: For a deeper dive, read the MDN: HTML Basics tutorial — it's the most authoritative HTML resource on the internet.
Have questions about this lesson? Not sure if your HTML file is correct? Ask me! I can review your code and explain anything that's unclear.