**`<h4>`** continues the nesting pattern one level deeper than `<h3>`. By this point in a document's outline, you're usually looking at fairly granular subsections — for example, individual method descriptions within a class's documentation, or specific steps within a broader instructional subsection. If you find yourself reaching for `<h4>` frequently, it's often worth double-checking whether the content could be restructured into fewer, clearer levels instead.
1Understanding <h4>
`<h4>` continues the nesting pattern one level deeper than <h3>. By this point in a document's outline, you're usually looking at fairly granular subsections — for example, individual method descriptions within a class's documentation, or specific steps within a broader instructional subsection. If you find yourself reaching for <h4> frequently, it's often worth double-checking whether the content could be restructured into fewer, clearer levels instead.
If a page's outline goes deeper than roughly h1 through h3 or h4 in most content, consider whether splitting it into multiple pages, or using lists/definition lists for the deepest details, would read more clearly than ever-deeper headings.
<h3>Array Methods</h3>
<h4>push()</h4>
<p>Adds an element to the end of an array.</p>
<h4>pop()</h4>
<p>Removes the last element of an array.</p>2Practical Example
Here is a real-world application of <h4> showing how it is used in production HTML.
<!-- Nested documentation detail -->
<h2>Configuration</h2>
<h3>Database Settings</h3>
<h4>Connection Pooling</h4>
<p>...</p>3Best Practices
Follow these guidelines when working with <h4>:
1. Use <h4> only nested within a preceding <h3>, continuing the logical outline
2. Reconsider very deep heading nesting (h5/h6) in favor of lists or restructuring
3. Keep heading text short and descriptive regardless of depth
Tip: If a page's outline goes deeper than roughly h1 through h3 or h4 in most content, consider whether splitting it into multiple pages, or using lists/definition lists for the deepest details, would read more clearly than ever-deeper headings.
<h3>Array Methods</h3>
<h4>push()</h4>
<p>Adds an element to the end of an array.</p>
<h4>pop()</h4>
<p>Removes the last element of an array.</p>