A A A A A

Heading Example

HTML Markup Details

h1 element
The h1 element should contain the title for the web resource and may contain the title of the website.
The page should contain at least one and no more than two h1 elements.
h2-h6 elements
The h2-h6 elements should identify major and minor sections of the web resource.
Headings should be properly nested following the heading levels represented by the numerical values of the heading elements.
  • h2 should be used as sub-heading after a h1
  • h3 should be used as sub-heading after a h2
  • h4 should be used as sub-heading after a h3
  • h5 should be used as sub-heading after a h4
  • h6 should be used as sub-heading after a h5

Example Code


<body>
...

  <h2>Main Navigation Bar title</h2>
...

  <h2>Quick Links Navigation Bar</h2>
...

<h1>Document title</h1>

  <h2>Section 1 title</h2>

    <h3>Sub-section 1.A title</h3>

      <p>Section content ...</p>


    <h3>Sub-section 1.B title</h3>

      <p>Section content ...</p>


    <h3>Sub-section 1.C title</h3>

      <p>Section content ...</p>


  <h2>Section 2 title</h2>

    <h3>Sub-section 2.A title</h3>

      <p>Section content ...</p>


    <h3>Sub-section 2.B title</h3>

      <p>Section content ...</p>


</body>

Navigation

Other HTML Best Practices

Working Group