Semantic Elements

HTML <h4> element

Identifies a level-4 heading in the document structure. Choose the level by its place in the heading hierarchy, not by the desired font size. Choose the heading rank according to the content hierarchy, not its default font size. Use CSS to adjust appearance, and avoid skipping ranks when a lower-level heading introduces a subsection. It accepts global HTML attributes; individual global features may be inapplicable or restricted.

Formal Syntax & Structure

html syntaxhtml
<h4>Heading</h4>

Return Value

HTMLHeadingElement

Content model: Phrasing content, with element-specific restrictions.

Working Example

Example Snippethtml
<!doctype html><html lang="en">  <head>    <meta charset="utf-8">    <title>HTML example</title>  </head>  <body>    <h1>Section level 1</h1>    <h2>Section level 2</h2>    <h3>Section level 3</h3>    <h4>Section level 4</h4>  </body></html>
HTML Reference