Path // www.yourhtmlsource.comReference → <h5>

<h5>


The <h5> element represents a fifth-level heading in the document's heading hierarchy. It is used for very specific subsections within an <h4> section. This deep level of nesting is relatively uncommon and typically appears in highly detailed technical documentation, legal documents, or academic content with complex organizational requirements.

Clock This page was last updated on 2025-11-17



Syntax

<h5>Detailed Subsection Title</h5>

Attributes

  • class - CSS class name
  • id - Unique identifier for linking
  • style - Inline CSS styles
  • title - Advisory information
  • lang - Language of the heading

Examples

Highly detailed documentation:

<h4>Configuration Parameters</h4>
<h5>Network Settings</h5>
<p>Port, timeout, retry logic...</p>
<h5>Security Settings</h5>
<p>Encryption, authentication...</p>
<h5>Logging Settings</h5>
<p>Log levels, output formats...</p>

Legal document structure:

<h3>Article 3: Terms of Service</h3>
<h4>Section 3.1: User Obligations</h4>
<h5>3.1.1 Account Security</h5>
<p>User responsibilities...</p>
<h5>3.1.2 Prohibited Activities</h5>
<p>Activities not allowed...</p>

Complete deep hierarchy:

<h2>Chapter 5</h2>
<h3>5.3 Advanced Topics</h3>
<h4>5.3.2 Error Handling</h4>
<h5>Try-Catch Blocks</h5>
<p>Implementation details...</p>
<h5>Custom Exceptions</h5>
<p>Creating exception classes...</p>

When to Use

Use <h5> sparingly, only when your content genuinely requires five levels of heading hierarchy. This depth is appropriate for comprehensive technical manuals, detailed API documentation, or content with very granular categorization needs. Most web content does not require this level of nesting.

Before using <h5>, consider whether your content would be better served by restructuring. Deeply nested headings can indicate that a page is trying to cover too much content. Consider breaking the content into multiple pages, or flattening the hierarchy by combining related subsections.

If <h5> is necessary, ensure it appears within proper hierarchical context following an <h4>. Maintain consistency in your heading usage throughout the document. Screen readers will announce "heading level 5," informing users of their deep position within the document structure. Clear, descriptive heading text becomes even more important at this level to help users understand context.

  • <h1> - Top-level heading
  • <h2> - Second-level heading
  • <h3> - Third-level heading
  • <h4> - Fourth-level heading
  • <h6> - Sixth-level heading
  • <p> - Paragraph