Episode 6 of 17

Headings and Text in HTML

Learn how to use headings (h1–h6), paragraphs, bold, italic, and other text formatting tags in HTML.

Text is the foundation of most web pages. HTML gives you powerful tags to structure and format text content.

Headings: h1 through h6

HTML provides six heading levels:

<h1>Main Page Title</h1>
<h2>Section Heading</h2>
<h3>Sub-section</h3>
<h4>Sub-sub-section</h4>
<h5>Minor heading</h5>
<h6>Smallest heading</h6>

<h1> is the biggest and most important. <h6> is the smallest.

Paragraphs

<p>This is a paragraph. Browsers add spacing above and below automatically.</p>
<p>This is another paragraph. Each one is a separate block.</p>

Text Formatting Tags

  • <strong>Bold / important text
  • <em>Italic / emphasized text
  • <u> — Underlined text
  • <mark> — Highlighted text
  • <small> — Smaller text (fine print)
  • <del> — Strikethrough text
  • <sub> — Subscript (H₂O)
  • <sup> — Superscript (x²)
<p>This is <strong>bold</strong> and this is <em>italic</em>.</p>
<p>Water formula: H<sub>2</sub>O</p>
<p>Area = πr<sup>2</sup></p>

Use these tags semantically<strong> means "important," not just "looks bold." For visual-only styling, use CSS instead.