Introduction

Text formatting plays a crucial role in emphasizing important information, improving readability, and guiding the reader's attention across your webpage.

In HTML, you have various tags specifically designed to format text without relying on CSS initially.

In this blog, we’ll explore how to make text bold, italic, underlined, and introduce other formatting tags realistically used in modern web development.


1. Why Formatting Matters in HTML

  • Emphasizes Key Points: Important phrases or actions stand out.
  • Enhances Readability: Well-formatted content is easier to scan.
  • Improves Accessibility: Screen readers can identify emphasized text when proper semantic tags are used.
  • Adds Semantic Meaning: Helps search engines understand the significance of content.

2. Common Text Formatting Tags in HTMLa

Tag Purpose Example Use Case
Bold text (visual only) Highlight keywords
Important text (semantic bold) Emphasizing critical warnings
Italic text (visual only) Styling foreign words
Emphasized text (semantic italic) Emphasizing an important phrase
Underlined text Denoting links or special text
Highlighted text Highlight search terms
Smaller text size Fine print or disclaimers
Deleted text (strikethrough) Show old price in pricing tables
Inserted text (underlined) Track changes or edits
Subscript text Chemical formulas
Superscript text Footnotes, exponents

3. Detailed Breakdown: With Syntax and Example

3.1 Bold Text

Syntax using :

This is a bold word in a sentence.
  • Purely visual. No semantic importance.

Syntax using :

This is a very important announcement.
  • Has semantic meaning: Screen readers announce this more strongly.

3.2 Italic Text

Syntax using :

He said it was a fait accompli.
  • Pure styling, usually for foreign words or phrases.

Syntax using :

You must complete the project on time.
  • Has semantic meaning: Emphasis on "must".

🔗 👉 Click here to read the full Blog on TheCampusCoders