Attributes
Attributes give extra information to an element. They live in the opening tag as name="value". Here href is the attribute and "page.html" is its value.
Learn HTML from the ground up: how browsers read it, how a page is structured, and how to write clean, accessible markup.
Every code panel has a Copy button. When you reach the playground, paste any example in and change it. Breaking things on purpose is a great way to learn.
Part 1
HTML stands for HyperText Markup Language. It is the language used to describe the content and structure of a web page. It is a markup language, not a programming language: it labels content ("this is a heading", "this is a link") rather than running instructions.
page.htmltags and texta web pageWhen you open an HTML file, the browser reads it from top to bottom. It uses the tags to build a model of the page, then draws that model on screen. HTML provides the structure. CSS (Module 04) styles it, and JavaScript (Module 05) makes it interactive.
Part 2
Every HTML page follows the same skeleton. Learn this one and you can start any page.
<!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>Welcome to my page.</p>
</body>
</html>Part 3
An element is a piece of the page. Most elements have an opening tag, some content, and a closing tag with a slash.
<a href="page.html">Opening tag, with an attributeVisit my pageContent</a>Closing tagAttributes give extra information to an element. They live in the opening tag as name="value". Here href is the attribute and "page.html" is its value.
Some elements have no content and no closing tag, such as <img>, <br>, and <meta>.
Elements go inside other elements. The rule: close the tag you opened last, first, like boxes inside boxes.
<p>This is <strong>important</strong> text.</p><p>This is <strong>important</p></strong> text.Part 4
h1 to h6. Use one h1 for the page title, then h2 for sections, and so on.
<h1>Main title</h1>
<h2>Section title</h2>
<h3>Subsection</h3>Use p for blocks of text. Browsers add space between paragraphs automatically.
<p>This is a paragraph.</p>
<p>This is another one.</p>The a (anchor) element links to another page. href holds the address.
<a href="lesson02.html">Back to Class 2</a>img shows a picture. src is the file, and alt describes it for people who cannot see it.
<img src="logo.png" alt="BWA Schools logo">ul makes a bulleted list and ol a numbered one. Each item is an li.
<ul>
<li>Drawing</li>
<li>Football</li>
</ul>
<ol>
<li>Open the file</li>
<li>Edit it</li>
</ol>button is something people click. Add behavior to it with JavaScript later. For going to another page, use a link instead.
<button type="button">Click me</button>Part 5
A div says nothing about its content. Semantic elements describe their role, which helps screen readers, search engines, and other developers understand your page.
<body>
<header>
<h1>My Website</h1>
</header>
<nav>
<a href="#about">About</a>
<a href="#contact">Contact</a>
</nav>
<main>
<section id="about">
<h2>About</h2>
<p>Hello! I am learning HTML.</p>
</section>
</main>
<footer>
<p>Copyright 2026</p>
</footer>
</body>Part 6
Indent each level of nesting by two spaces. The browser does not care, but you will, when you need to find a mistake.
<ul>
<li>One</li>
<li>Two</li>
</ul><ul>
<li>One</li>
<li>Two</li>
</ul>alt text to every meaningful image, so screen reader users know what it shows.lang on the html element, so assistive technology pronounces text correctly.h1, then h2, then h3. Do not pick a heading just for its size.button and a elements work with the keyboard automatically.Mistake: <p>Hello
Fix: <p>Hello</p>
Mistake: <b><i>Hi</b></i>
Fix: <b><i>Hi</i></b>
Mistake: <img src="cat.png">
Fix: <img src="cat.png" alt="A grey cat">
Mistake: <a href=page.html>
Fix: <a href="page.html">
Mistake: an h4 because it looks small.
Fix: Pick the right level, and change the size later with CSS.
Mistake: starting the file with <html>.
Fix: Always begin with <!DOCTYPE html>.
Practice
Edit the code and press Run. The preview is isolated in a sandbox: scripts are blocked and links will not open from inside it. Try pasting any example from this lesson.
Preview
Challenge
Use what you learned to build a page about yourself. Edit the starter, press Preview my page, and watch the checklist tick as your code meets each goal.
Checklist
Knowledge check
Tried the playground, built your page, and passed the quiz? Mark the lesson complete. Progress is saved in this browser only.
Module 03 complete. You can now write and structure a real HTML page.