Headings & Text in HTML
From the HTML cheat sheet Ā· Text & Content Elements Ā· verified Jul 2026
Headings & Text
Basic text elements and hierarchy
css
<!-- Headings (h1-h6) -->
<h1>Main Page Title</h1>
<h2>Section Heading</h2>
<h3>Subsection</h3>
<h4>Sub-subsection</h4>
<h5>Minor Heading</h5>
<h6>Smallest Heading</h6>
<!-- Paragraphs and line breaks -->
<p>This is a paragraph of text.</p>
<p>Another paragraph with a<br>line break.</p>
<!-- Text formatting -->
<strong>Bold/Important text</strong>
<em>Italic/Emphasized text</em>
<mark>Highlighted text</mark>
<small>Small print</small>
<del>Deleted text</del>
<ins>Inserted text</ins>
<sub>Subscript</sub>
<sup>Superscript</sup>html
<h1>Main Title</h1>
<p>This is <strong>bold</strong> and <em>italic</em> text.</p>
<p>H<sub>2</sub>O and x<sup>2</sup></p>
<p><mark>Highlighted</mark> and <del>deleted</del> text.</p>š¢ Essential - Use semantic text elements
š” Only one h1 per page for SEO
š strong vs b: semantic importance vs visual
ā” Use code for inline code, pre for blocks
ā ļø Don't skip heading levels (h1āh3)
textheadingsformatting