0

As I understand it, good HTML5 practice is to name all sections using h2-h6 tags:

<section id='chapter_one' class='chapter'>
  <h3>Chapter One</h3>
  <p>My site has lots of content.</p>
</section>

Without the element the w3c Validator gives "Section lacks heading. Consider using h2-h6 elements to add identifying headings to all sections". That's fine, but is there a way to use an in-line element rather than a block element for the section label?

<section id='chapter_one' class='chapter'>
  <p>Welcome to <span>Chapter One</span> of my fine content rich site.</p>
</section>

References: http://www.smashingmagazine.com/2013/01/18/the-importance-of-sections/ and w3c html validation error - Section lacks heading. Consider using h2-h6 elements to add identifying headings to all sections and Is it necessary to have a heading of <section> in HTML5

Community
  • 1
  • 1
Bryce
  • 8,313
  • 6
  • 55
  • 73

1 Answers1

0

No.

As the HTML5 spec defines in Headings and sections:

The first element of heading content in an element of sectioning content represents the heading for that section.

And the heading content category contains:

h1, h2, h3, h4, h5, h6

unor
  • 92,415
  • 26
  • 211
  • 360
  • How about aria-labelledby="chapter_{{id}}" – Bryce Oct 03 '14 at 20:04
  • @Bryce: WAI-ARIA doesn’t affect the document outline. (It can help assistive technologies, but it’s not necessarily used by other consumers of your HTML.) – unor Oct 03 '14 at 20:12