Course Content
Project file
0/1
Complete Web Designing Course for Beginners

✨ Lesson 1.4 – Text Formatting Tags

🎨 Making Text Attractive and Meaningful Using HTML Formatting Tags


🎯 Learning Objectives

After completing this lesson, students will be able to:

βœ… Understand text formatting in HTML

βœ… Make text bold

βœ… Make text italic

βœ… Underline text

βœ… Highlight text

βœ… Create superscript and subscript text

βœ… Display deleted and inserted text

βœ… Use formatting tags professionally


πŸ“– Introduction

Imagine reading a book where every word looks exactly the same.

Example:

Welcome to NextGen Dev Hub. This course teaches web designing and web development.

It is readable, but important words do not stand out.

Now look at this:

Welcome to NextGen Dev Hub.

This course teaches WEB DESIGNING and WEB DEVELOPMENT.

Now important information is easier to identify.

This is called:

✨ Text Formatting

Text formatting helps make content:

βœ… Attractive

βœ… Easy to Read

βœ… Professional

βœ… More Understandable

HTML provides several formatting tags for this purpose.


🎨 What is Text Formatting?

Text formatting means changing the appearance of text.

Examples:

  • Bold Text
  • Italic Text
  • Underlined Text
  • Highlighted Text
  • Small Text
  • Superscript
  • Subscript

🌟 Why Text Formatting is Important

Imagine a college website.

Without formatting:

Admission Open 2026 Last Date 30 June

With formatting:

Admission Open 2026

Last Date: 30 June

Much easier to understand.

Formatting improves communication.


πŸ”₯ Bold Text

Bold text is used to emphasize important information.

HTML Tag:

<b>

Example

<b>Welcome Students</b>

Output

Welcome Students


Real Life Example

<p>
Course Fee: <b>β‚Ή999</b>
</p>

Output:

Course Fee: β‚Ή999


🌟 Strong Tag

HTML also provides:

<strong>

This tag also makes text bold.


Example

<strong>Important Notice</strong>

Output:

Important Notice


Difference Between b and strong

b Tag

Makes text bold.


strong Tag

Makes text bold and indicates importance.


Professional Recommendation

Use:

<strong>

for important content.


✍️ Italic Text

Italic text is often used for:

  • Quotes
  • Special Terms
  • Emphasis

Tag:

<i>

Example

<i>Web Designing Course</i>

Output:

Web Designing Course


🌟 Emphasis Tag

HTML also provides:

<em>

Example

<em>Important Concept</em>

Output:

Important Concept


Difference

i

Visual Italic

em

Meaningful Emphasis


Professional Recommendation

Use:

<em>

when emphasizing content.


πŸ“ Underline Text

Used to underline text.

Tag:

<u>

Example

<u>Admission Open</u>

Output:

<u>Admission Open</u>


Real Life Example

<p>
Last Date:
<u>30 June 2026</u>
</p>

πŸ–οΈ Highlighted Text

Sometimes we want to highlight important information.

HTML Tag:

<mark>

Example

<mark>Important Announcement</mark>

Output:

<mark>Important Announcement</mark>


Real Life Example

<p>
New Batch Starts On
<mark>1 July 2026</mark>
</p>

❌ Deleted Text

Used to show removed content.

Tag:

<del>

Example

<del>β‚Ή2000</del>

Output:

β‚Ή2000


Real Life Example

<p>
Old Price:
<del>β‚Ή2000</del>

New Price:
β‚Ή999
</p>

Output:

Old Price: β‚Ή2000

New Price: β‚Ή999


βž• Inserted Text

Used to indicate newly added content.

Tag:

<ins>

Example

<ins>New Offer Available</ins>

Output:

<ins>New Offer Available</ins>


πŸ”½ Subscript Text

Subscript text appears slightly below the normal line.

Tag:

<sub>

Example

Water Formula:

H<sub>2</sub>O

Output:

Hβ‚‚O


More Examples

CO<sub>2</sub>

Output:

COβ‚‚


H<sub>2</sub>SO<sub>4</sub>

Output:

Hβ‚‚SOβ‚„


πŸ”Ό Superscript Text

Superscript text appears slightly above the normal line.

Tag:

<sup>

Example

x<sup>2</sup>

Output:

xΒ²


More Examples

10<sup>2</sup>

Output:

10Β²


a<sup>3</sup>

Output:

aΒ³


πŸ”  Small Text

Used for less important information.

Tag:

<small>

Example

<small>Terms and Conditions Apply</small>

Output:

<small>Terms and Conditions Apply</small>


πŸ’» Complete Example

Β 
<!DOCTYPE html>

<html>

<head>

<title>Text Formatting</title>

</head>

<body>

<h1>Text Formatting Example</h1>

<p>
<b>Bold Text</b>
</p>

<p>
<strong>Strong Text</strong>
</p>

<p>
<i>Italic Text</i>
</p>

<p>
<em>Emphasized Text</em>
</p>

<p>
<u>Underlined Text</u>
</p>

<p>
<mark>Highlighted Text</mark>
</p>

<p>
<del>Old Price β‚Ή2000</del>
</p>

<p>
<ins>New Price β‚Ή999</ins>
</p>

<p>
H<sub>2</sub>O
</p>

<p>
x<sup>2</sup>
</p>

</body>

</html>
Β 

🎯 Expected Output

Displays:

βœ… Bold Text

βœ… Strong Text

βœ… Italic Text

βœ… Emphasized Text

βœ… Underlined Text

βœ… Highlighted Text

βœ… Deleted Text

βœ… Inserted Text

βœ… Hβ‚‚O

βœ… xΒ²


🏫 Real World Example

College Admission Notice:

Β 
<h1>Admission Notice</h1>

<p>
Admissions for <strong>2026 Session</strong> are now open.
</p>

<p>
Last Date:
<mark>30 June 2026</mark>
</p>

<p>
Old Fee:
<del>β‚Ή25000</del>
</p>

<p>
New Fee:
<ins>β‚Ή20000</ins>
</p>

This looks professional and easy to understand.


⚠️ Common Beginner Mistakes


Mistake 1

Using Too Much Formatting

Bad:

<b>
<u>
<i>
Everything
</i>
</u>
</b>

Over-formatting reduces readability.


Mistake 2

Using Bold for Entire Paragraph

Bad:

<b>
Entire paragraph here...
</b>

Use bold only for important content.


Mistake 3

Incorrect Closing Tags

Wrong:

<b>Welcome

Correct:

<b>Welcome</b>

🌟 Best Practices

βœ… Use Bold for important information.

βœ… Use Italics for emphasis.

βœ… Use Highlighting sparingly.

βœ… Use Superscript for powers.

βœ… Use Subscript for chemical formulas.

βœ… Avoid excessive formatting.


πŸ† Mini Project – Student Information Card

Create:

Β 
<!DOCTYPE html>

<html>

<head>

<title>Student Information</title>

</head>

<body>

<h1>Student Profile</h1>

<p>
Name:
<strong>Rahul Kumar</strong>
</p>

<p>
Branch:
<em>Computer Science</em>
</p>

<p>
Semester:
<u>Third Semester</u>
</p>

<p>
Admission Status:
<mark>Active</mark>
</p>

<p>
Water Formula:
H<sub>2</sub>O
</p>

<p>
Math Formula:
x<sup>2</sup>
</p>

</body>

</html>
Β 
Β 

πŸ“ Practical Activity

Create a webpage containing:

Your Name (Bold)

Your College (Italic)

Your Branch (Underlined)

Your Semester (Highlighted)

Hβ‚‚O using Subscript

xΒ² using Superscript

Run it in Chrome.


πŸ“‹ Assignment

Assignment 1.4

Answer the following:

  1. What is text formatting?
  2. Which tag creates bold text?
  3. Which tag creates italic text?
  4. Which tag highlights text?
  5. What is the difference between superscript and subscript?
  6. Write the HTML code for Hβ‚‚O.
  7. Write the HTML code for xΒ².

🧠 Quiz

Q1. Which tag creates bold text?

A. <i>

B. <b>

C. <u>

D. <p>

βœ… Answer: B


Q2. Which tag highlights text?

A. <mark>

B. <u>

C. <strong>

D. <small>

βœ… Answer: A


Q3. Which tag creates superscript text?

A. <sub>

B. <sup>

C. <small>

D. <mark>

βœ… Answer: B


Q4. Which tag creates subscript text?

A. <sub>

B. <sup>

C. <ins>

D. <del>

βœ… Answer: A


Q5. Which formula correctly displays water?

A. H2O

B. H<sup>2</sup>O

C. H<sub>2</sub>O

D. HO2

βœ… Answer: C


πŸ“Œ Lesson Summary

βœ… Text formatting improves readability and presentation.

βœ… <b> and <strong> create bold text.

βœ… <i> and <em> create italic text.

βœ… <u> creates underlined text.

βœ… <mark> highlights important content.

βœ… <sub> creates subscript text.

βœ… <sup> creates superscript text.

βœ… Proper formatting helps create professional webpages.

Scroll to Top