<h5>
Defines a level 5 heading (minor heading)
Quick Answer
What is the HTML <h5> tag?
The <h5> tag defines a level 5 heading in HTML's heading hierarchy (h1-h6). It represents sub-subsection titles within deeply nested content structures. Use headings in proper order without skipping levels. While less visually prominent than h1-h4, h5 maintains semantic document structure for accessibility and SEO.
Definition and Usage
The <h5> element establishes a level 5 heading
in an HTML document. It represents minor headings with lower
importance, typically used for very specific details.
HTML headings are defined with the <h1> to
<h6> tags, where <h1> is the
most important and <h6> is the least important.
<h5> tags for minor
headings in highly detailed content. H5 is rarely used in typical
web pages but can be valuable in technical documentation.
Browser support and standards
Browser rendering and modern HTML conformance are different questions. Check the current element reference for the browsers and features your project needs; the older source version table is not a current compatibility guarantee.
Read the MDN element referenceExamples
Basic H5 Heading
Create minor headings with H5:
Example
<h1>Technical Documentation</h1>
<h2>API Reference</h2>
<h3>Authentication</h3>
<h4>OAuth 2.0</h4>
<h5>Authorization Code Flow</h5>
<p>Step-by-step implementation details...</p>
<h5>Implicit Flow</h5>
<p>Alternative authentication method...</p>
H5 with Styling
Style minor headings with CSS:
Example
<style>
h5 {
color: #6b7280;
font-size: 14px;
font-weight: 600;
margin-top: 16px;
margin-bottom: 8px;
text-transform: uppercase;
letter-spacing: 1px;
}
</style>
<h5>Minor Detail</h5>
Document Structure with H5
Very detailed content hierarchy:
Example
<article>
<h1>Database Design Guide</h1>
<h2>Relational Databases</h2>
<h3>Table Design</h3>
<h4>Primary Keys</h4>
<h5>Auto-Increment Keys</h5>
<p>Using sequential IDs...</p>
<h5>UUID Keys</h5>
<p>Using universally unique identifiers...</p>
<h5>Composite Keys</h5>
<p>Multiple column primary keys...</p>
</article>
Complete Hierarchy Example
All heading levels in context:
Example
<article>
<h1>Advanced React Patterns</h1>
<h2>State Management</h2>
<h3>Context API</h3>
<h4>Creating Context</h4>
<h5>Context Provider Setup</h5>
<p>Configure the context provider component...</p>
<h5>Context Consumer Patterns</h5>
<p>Different ways to consume context...</p>
<h5>Performance Optimization</h5>
<p>Avoid unnecessary re-renders...</p>
</article>
Heading Hierarchy
HTML headings follow a hierarchical structure from
<h1> to <h6>:
<h5> before
establishing all previous heading levels (H1 through H4).
Default Heading Sizes
Comparison of default sizes for all heading tags:
| Tag | Default Size | Importance | Usage |
|---|---|---|---|
| <h1> | 2em (32px) | Most Important | Main page title (one per page) |
| <h2> | 1.5em (24px) | High | Major section headings |
| <h3> | 1.17em (18.72px) | Medium-High | Subsection headings |
| <h4> | 1em (16px) | Medium | Sub-subsection headings |
| <h5> | 0.83em (13.28px) | Low | Minor headings |
| <h6> | 0.67em (10.72px) | Least Important | Lowest level headings |
SEO Best Practices
- Rare Usage: H5 is rarely needed for most websites
- Technical Content: Best suited for very detailed technical documentation
- Specific Details: Use for very specific, granular information
- Proper Order: H5 must follow H4 in the hierarchy
- Content Depth: Indicates extremely detailed content structure
- Clarity: Keep H5 headings clear despite their minor importance
- Alternative Options: Consider using lists or bold text instead of H5
Accessibility
Screen readers and assistive technologies rely on heading structure for navigation:
- Deep Navigation: H5 provides very specific navigation points
- Complex Content: Useful for navigating highly detailed content
- Hierarchy Depth: Shows deep content nesting
- Proper Order: Must follow H1 → H2 → H3 → H4 → H5
- Meaningful Text: H5 should describe specific content
- Consider Alternatives: Sometimes lists are more accessible than deep headings
CSS Styling Examples
Minimal H5 Style
Example
<style>
h5 {
font-size: 13px;
font-weight: 600;
color: #6b7280;
margin: 12px 0 8px 0;
font-variant: small-caps;
}
</style>
<h5>Specific Detail</h5>
H5 with Subtle Highlight
Example
<style>
h5 {
font-size: 13px;
font-weight: 600;
color: #374151;
margin: 12px 0 6px 0;
padding: 4px 8px;
background: #f9fafb;
border-radius: 4px;
display: inline-block;
}
</style>
<h5>Minor Topic</h5>
Compact H5 Style
Example
<style>
h5 {
font-size: 13px;
font-weight: 600;
color: #9ca3af;
margin: 10px 0 6px 0;
text-transform: uppercase;
letter-spacing: 0.5px;
}
</style>
<h5>Note</h5>
Best Practices
- Use H5 only for very detailed, technical content
- Ensure H5 relates to its parent H4 section
- Keep H5 headings brief and specific
- Follow hierarchy: H1 → H2 → H3 → H4 → H5
- Consider if simpler structure would work better
- Use H5 before establishing H1 through H4
- Skip from H4 to H6 without H5
- Use H5 in simple content (use H2 or H3 instead)
- Choose H5 based on visual size alone
- Overuse H5 - most sites don't need it
When to Use H5
H5 headings are appropriate in these scenarios:
- API Documentation: Detailed method parameters and return values
- Technical Manuals: Very specific procedural steps
- Research Papers: Deep subsection analysis
- Legal Documents: Nested clauses and sub-clauses
- Product Specifications: Detailed feature breakdowns