Headings, Paragraphs & Formatting
Text is the heart of every webpage. In this chapter, you will learn how to use headings, paragraphs, line breaks, horizontal rules and formatting tags to make content clear and meaningful.
<h1> to <h6>
Used to create content headings and page structure.
<p>
Used to write paragraph text on a webpage.
<strong>, <em>, <mark>
Used to add meaning and emphasis to important words.
<sub> and <sup>
Used for formulas like H₂O and powers like x².
After This Chapter, You Will Understand
This chapter helps you write readable and well-structured webpage content.
Headings
Use h1 to h6 headings in correct order.
Paragraphs
Write clear paragraphs using the p tag.
Formatting
Apply bold, italic, mark, small, delete and insert formatting.
Sub & Sup
Write formulas and powers using subscript and superscript.
Heading Tags: h1 to h6
Headings organize content and help users understand the page structure.
1 What are Headings?
HTML provides six heading levels from <h1> to <h6>. The h1 tag is the most important heading and h6 is the least important.
<h2>Section Heading</h2>
<h3>Sub Section Heading</h3>
<h4>Small Heading</h4>
<h5>Minor Heading</h5>
<h6>Smallest Heading</h6>
Main Page Heading
Section Heading
Sub Section Heading
Small Heading
Minor Heading
Smallest Heading
Paragraph, Line Break and Horizontal Rule
These tags help you write readable body content.
2 Paragraph Tag
The <p> tag is used to write paragraph text.
3 Line Break
The <br> tag is used to break a line.
Line two
4 Horizontal Rule
The <hr> tag creates a horizontal line.
<hr>
Common HTML Text Formatting Tags
Formatting tags help highlight and present text with better meaning.
| Tag | Use | Example Output |
|---|---|---|
| <b> | Makes text bold visually | Bold Text |
| <strong> | Shows important text with meaning | Important Text |
| <i> | Makes text italic visually | Italic Text |
| <em> | Shows emphasized text with meaning | Emphasized Text |
| <mark> | Highlights text | Marked Text |
| <small> | Shows smaller text | Small Text |
| <del> | Shows deleted text | |
| <ins> | Shows inserted text | New Text |
| <sub> | Subscript text | H2O |
| <sup> | Superscript text | x2 |
Visual Formatting vs Semantic Formatting
Some tags only change appearance, while some tags also add meaning.
Visual Formatting
These tags mostly affect appearance.
- <b> makes text bold
- <i> makes text italic
- <u> underlines text
Semantic Formatting
These tags add meaning to the content.
- <strong> means important text
- <em> means emphasized text
- <mark> means highlighted text
Practice Headings and Formatting
Edit the code and click Run Code to see the output.
Mistakes Students Should Avoid
Correct heading and text structure makes your page professional.
Wrong Habits
- Using h1 only to make text large
- Skipping heading levels randomly
- Writing long content without paragraphs
- Using br tags repeatedly for spacing
- Using bold everywhere without purpose
Correct Habits
- Use h1 for main page topic
- Use h2 for major sections
- Use p tag for paragraph content
- Use CSS later for spacing
- Use strong and em for meaningful emphasis
Test Your Understanding
Select the correct answers and check your score.
1. Which heading tag is the most important?
2. Which tag is used for paragraph text?
3. Which tag means important text?
4. Which tag is used for subscript?
5. Which tag creates a horizontal line?
Remember These Points
Revise these before moving to Chapter 6.
Headings
HTML has six heading levels from h1 to h6.
Paragraph
The p tag is used to write paragraph content.
Line Break
The br tag is used to move content to the next line.
Horizontal Rule
The hr tag creates a horizontal line.
Strong & Em
Strong shows importance, and em shows emphasis.
Sub & Sup
Subscript and superscript are used for formulas and powers.