🧠 Quick Quiz
Q1: Where does the visible content of a webpage go?
Q2: What does <!DOCTYPE html> do?
Headings & Paragraphs
Master the most commonly used HTML elements for text content.
📰 HTML Headings (h1 to h6)
HTML has 6 levels of headings. <h1> is the most important (largest), and <h6> is the least important (smallest).
💡 Best Practice: Use only ONE <h1> per page (for SEO). Use headings in order — don't skip from h1 to h4!
📝 Paragraphs & Line Breaks
The <p> tag creates paragraphs. Browsers add space before and after each paragraph automatically.
⚠️ Note: Extra spaces and line breaks in your HTML code are ignored by the browser. Use <br> for line breaks and <p> for new paragraphs.
✍️ Practice Time!
Create a mini article with:
- An h1 main title
- An h2 subtitle
- Two paragraphs
- A horizontal rule (<hr>) between them
🧠 Quick Quiz
Q1: Which heading is the smallest?
Q2: What does <hr> do?
Text Formatting
Learn how to make text bold, italic, underlined, and more!
✨ Formatting Tags
| Tag | Effect | Use When |
|---|---|---|
<b> | Bold | Visual bold |
<strong> | Strong (Bold) | Important text (better for SEO) |
<i> | Italic | Visual italic |
<em> | Emphasized (Italic) | Stressed text (better for SEO) |
<u> | Underline | Underlined text |
<s> | Deleted/incorrect text | |
<mark> | Highlighted | Highlighted text |
<small> | Small text | Fine print |
<sub> | H2O | Subscript |
<sup> | x2 | Superscript |
📝 Code Examples
💡 strong vs b: Both look the same, but <strong> tells search engines "this is important", while <b> is just visual styling.
✍️ Practice Formatting!
Create text with at least 3 different formatting tags (bold, italic, and one more of your choice).
🧠 Quick Quiz
Q1: Which tag is better for SEO to show important text?
Q2: To write H₂O, which tag wraps the "2"?
Links (Anchor Tag)
Links connect web pages together — they are the backbone of the web!
🔗 The Anchor Tag <a>
The <a> tag creates hyperlinks. The href attribute specifies where the link goes.
| Attribute | Purpose | Example |
|---|---|---|
href | URL destination | href="https://..." |
target="_blank" | Opens in new tab | target="_blank" |
title | Tooltip on hover | title="Go to Google" |
✍️ Create Links!
Create two links: one to any website, and one that opens in a new tab.
🧠 Quick Quiz
Q1: Which attribute specifies the URL in a link?
Q2: How do you open a link in a new tab?
Images
Learn how to add images to your web pages!
🖼️ The Image Tag <img>
The <img> tag embeds images. It is a self-closing tag (no closing tag needed).
| Attribute | Required? | Purpose |
|---|---|---|
src | ✅ Yes | Path/URL to the image |
alt | ✅ Yes | Text if image can't load + accessibility |
width | Optional | Width in pixels |
height | Optional | Height in pixels |
⚠️ Always add alt text! It helps visually impaired users and shows text when images don't load.
✍️ Add an Image!
Add an image using a URL. Include the src and alt attributes.
🧠 Quick Quiz
Q1: Which attribute specifies the image source?
Q2: Does the <img> tag need a closing tag?
Lists (Ordered & Unordered)
Organize information using ordered and unordered lists!
📋 Two Types of Lists
| Type | Tag | Marker | Use When |
|---|---|---|---|
| Unordered List | <ul> | • Bullets | Order doesn't matter |
| Ordered List | <ol> | 1. Numbers | Order matters (steps) |
| List Item | <li> | — | Each item in a list |
✍️ Create Both Types of Lists!
Create an unordered list (ul) AND an ordered list (ol), each with at least 3 items.
🧠 Quick Quiz
Q1: Which tag creates a bullet-point list?
HTML Attributes
Attributes provide extra information about HTML elements.
⚙️ What are Attributes?
Attributes are extra information added to HTML tags. They always go in the opening tag and come in name="value" pairs.
| Attribute | Purpose | Used With |
|---|---|---|
id | Unique identifier (used once per page) | Any tag |
class | Group identifier (reusable) | Any tag |
style | Inline CSS styles | Any tag |
title | Tooltip text on hover | Any tag |
href | Link destination | <a> |
src | Source file path | <img>, <video> |
alt | Alternative text | <img> |
✍️ Use Attributes!
Create elements using style, id, and title attributes.
🧠 Quick Quiz
Q1: Where do attributes go?
HTML Tables
Display data in organized rows and columns.
📊 Table Tags
| Tag | Purpose |
|---|---|
<table> | Creates the table |
<tr> | Table Row |
<th> | Table Header cell (bold, centered) |
<td> | Table Data cell (normal) |
✍️ Build a Table!
Create a table with headers and at least 2 data rows.
🧠 Quick Quiz
Q1: Which tag creates a table row?
Forms - Input Fields
Forms allow users to enter data — login forms, search bars, and more!
📝 Form Basics
| Input Type | Purpose |
|---|---|
text | Single-line text |
email | Email (validates format) |
password | Hidden text (dots) |
number | Numbers only |
date | Date picker |
checkbox | Checkboxes |
radio | Radio buttons |
submit | Submit button |
✍️ Build a Form!
Create a registration form with name, email, password fields and a submit button.
🧠 Quick Quiz
Q1: Which input type hides the characters typed?
Forms - Advanced Controls
Checkboxes, radio buttons, dropdowns, and text areas!
🎛️ More Form Elements
💡 Radio vs Checkbox: Radio buttons with the same name attribute allow only ONE selection. Checkboxes allow MULTIPLE selections.
✍️ Build a Survey Form!
Create a form with radio buttons, checkboxes, a dropdown, and a textarea.
🧠 Quick Quiz
Q1: Which allows multiple selections?
Div & Span (Containers)
Learn the two most important container elements in HTML!
📦 Div vs Span
| Element | Type | Purpose | Behavior |
|---|---|---|---|
<div> | Block | Group large sections | Takes full width, new line |
<span> | Inline | Style small text parts | Stays in the same line |
✍️ Use Div & Span!
Create a styled div container and use span to color a word differently.
🧠 Quick Quiz
Q1: Which element is a block-level container?
Semantic HTML
Use meaningful tags that describe their content!
🏛️ What is Semantic HTML?
Semantic means "relating to meaning." Semantic HTML uses tags that clearly describe their purpose.
| Semantic Tag | Purpose | Replaces |
|---|---|---|
<nav> | Navigation links | <div class="nav"> |
<main> | Main content | <div class="main"> |
<section> | A section of content | <div class="section"> |
<article> | Independent content | <div class="article"> |
<aside> | Side content | <div class="sidebar"> |
<figure> | Image with caption | <div class="image"> |
<figcaption> | Caption for figure | <p class="caption"> |
💡 Why use semantic tags? Better SEO, better accessibility for screen readers, and cleaner/more readable code!
✍️ Use Semantic Tags!
Build a page structure using nav, main, article, and section tags.
🧠 Quick Quiz
Q1: Which tag is used for navigation links?
🎓 Build Your Own Webpage!
Put everything together! Build a complete webpage using everything you've learned.
🎯 Your Mission
Create a personal profile page that includes:
- ✅ Proper HTML structure (DOCTYPE, html, head, body)
- ✅ A page title
- ✅ Headings (h1, h2)
- ✅ Paragraphs with formatted text (bold, italic)
- ✅ An image
- ✅ A list (ordered or unordered)
- ✅ At least one link
- ✅ A simple form (contact form)
- ✅ Use of div containers
- ✅ Some inline styling
🚀 Your Final Project Editor
Build your masterpiece below! Use everything you've learned. The starter code gives you a template — customize it to make it your own!
') && code.includes('
') && code.includes('') && code.includes('
')) { showResult('result2', true, '🎉 Excellent! You used h1 and p tags correctly!'); awardExercisePoints('ex2'); runCode('editor2', 'preview2'); } else { showResult('result2', false, '❌ Make sure you have both...
and...
tags.'); } } function checkExercise3() { const code = document.getElementById('editor3').value.toLowerCase(); if (code.includes('') && code.includes('') && code.includes('') && code.includes('')) {
showResult('result3', true, '🎉 Perfect HTML structure! You nailed it!');
awardExercisePoints('ex3');
runCode('editor3', 'preview3');
} else {
showResult('result3', false, '❌ Make sure you have DOCTYPE, html, head, title, body, and h1 tags.');
}
}
function checkExercise4() {
const code = document.getElementById('editor4').value.toLowerCase();
if (code.includes('') && code.includes('') && code.includes('
') && code.includes('
') && code.includes('
', '', '', '', '', '
- ') && code.includes('
- ')) {
showResult('result8', true, '🎉 Both list types created!');
awardExercisePoints('ex8');
runCode('editor8', 'preview8');
} else {
showResult('result8', false, '❌ Include both
- and
- items.');
}
}
function checkExercise9() {
const code = document.getElementById('editor9').value.toLowerCase();
if (code.includes('style=') && (code.includes('id=') || code.includes('class='))) {
showResult('result9', true, '🎉 Attributes used correctly!');
awardExercisePoints('ex9');
runCode('editor9', 'preview9');
} else {
showResult('result9', false, '❌ Use style and id/class attributes.');
}
}
function checkExercise10() {
const code = document.getElementById('editor10').value.toLowerCase();
if (code.includes('
') && code.includes('
') && code.includes(' ')) { showResult('result10', true, '🎉 Table created with headers and data!'); awardExercisePoints('ex10'); runCode('editor10', 'preview10'); } else { showResult('result10', false, '❌ Include table, tr, th, and td tags.'); } } function checkExercise11() { const code = document.getElementById('editor11').value.toLowerCase(); if (code.includes('
- with
- items.');
}
}
function checkExercise9() {
const code = document.getElementById('editor9').value.toLowerCase();
if (code.includes('style=') && (code.includes('id=') || code.includes('class='))) {
showResult('result9', true, '🎉 Attributes used correctly!');
awardExercisePoints('ex9');
runCode('editor9', 'preview9');
} else {
showResult('result9', false, '❌ Use style and id/class attributes.');
}
}
function checkExercise10() {
const code = document.getElementById('editor10').value.toLowerCase();
if (code.includes('