Learn to build the structure of web pages — the skeleton that everything else is built on.
HTML stands for HyperText Markup Language. Let's break that down:
Every HTML page follows this skeleton. Edit the code and click Run to see how it looks:
A tag has three parts:
<tag> needs a </tag>. The closing tag has a forward slash / before the tag name.
HTML has different tags for different types of text. Try editing and running the code below:
| Tag | What It Does | Example |
|---|---|---|
<h1>-<h6> | Headings (h1=biggest, h6=smallest) | Page titles, section titles |
<p> | Paragraph | Any block of text |
<strong> | Bold + important | Key information |
<em> | Italic + emphasis | Emphasized words |
<br> | Line break | New line (no closing tag needed!) |
<hr> | Horizontal line | Section divider (no closing tag!) |
<mark> | Highlighted text | Important terms |
<a>) is like a door — click it and you go somewhere else. An image (<img>) is like a photo frame — it displays a picture on your page.
Attributes give extra information about a tag. They go inside the opening tag:
<tr> with <td> cells)| Type | What It Creates | Example |
|---|---|---|
text | Basic text field | Name, address |
email | Email with validation | user@example.com |
password | Hidden text field | ●●●●●● |
number | Number with arrows | Age, quantity |
date | Date picker | Birthday |
checkbox | Tick box | "I agree to terms" |
radio | One choice from group | Gender selection |
file | File upload | Upload resume |
<div> for everything (which just means "a box"), semantic tags tell the browser AND search engines WHAT the content IS. It's like the difference between a box labeled "stuff" vs one labeled "kitchen utensils."
| Semantic Tag | Meaning | Instead of... |
|---|---|---|
<header> | Top of page (logo, nav) | <div class="header"> |
<nav> | Navigation links | <div class="nav"> |
<main> | Main content | <div class="content"> |
<article> | Self-contained content | <div class="post"> |
<aside> | Sidebar info | <div class="sidebar"> |
<footer> | Bottom of page | <div class="footer"> |
<section> | A themed group | <div class="section"> |
1. Which tag creates a paragraph?
2. What does the alt attribute do in an <img> tag?
3. What's the difference between <ul> and <ol>?
4. Where does the <title> tag go?
5. How do you make a form field mandatory?