Skip to main content
Course/Module 2/Topic 1 of 4Beginner

Text Formatting Tags

HTML has many tags to format text: bold, italic, underline, strikethrough, and more.

20 minBy Priygop TeamLast updated: Feb 2026

Formatting Text in HTML

HTML provides tags to visually format text. <strong> makes text bold (and marks it as important). <em> makes text italic (emphasis). <u> underlines text. <mark> highlights text. These tags add both visual style and semantic meaning.

Common Formatting Tags

  • <strong> — Bold text (important content)
  • <em> — Italic text (emphasis)
  • <u> — Underlined text
  • <mark> — Highlighted text (yellow background)
  • <s> or <del> — Strikethrough text
  • <small> — Smaller text
  • <sup> — Superscript (e.g. x²)
  • <sub> — Subscript (e.g. H₂O)

Formatting Example

Example
<!DOCTYPE html>
<html>
<body>
  <p>This is <strong>bold</strong> text.</p>
  <p>This is <em>italic</em> text.</p>
  <p>This is <u>underlined</u> text.</p>
  <p>This is <mark>highlighted</mark> text.</p>
  <p>This is <s>strikethrough</s> text.</p>
  <p>Water formula: H<sub>2</sub>O</p>
  <p>Power: x<sup>2</sup></p>
  <p><strong><em>Bold and italic</em></strong> together.</p>
</body>
</html>

Try It Yourself: Text Formatting

Try It Yourself: Text FormattingHTML
HTML Editor
✓ ValidTab = 2 spaces
HTML|12 lines|332 chars|✓ Valid syntax
UTF-8

Quick Quiz

Chat on WhatsApp
Priygop - Leading Professional Development Platform | Expert Courses & Interview Prep