Note that there are some explanatory texts on larger screens.

plurals
  1. POIn HTML5, is it better to use <section> and <h1> instead of <h2>–<h6>?
    text
    copied!<p>In studying up on HTML5's new section tag, I'm wondering about the handling of h1, h2, h3, h4, h5, and h6 tags...</p> <p>The HTML5 specification says that "[h1, h2, etc.] elements represent headings for <em>their sections</em>" (<a href="http://www.w3.org/TR/html5/sections.html#the-h1-h2-h3-h4-h5-and-h6-elements" rel="noreferrer">http://www.w3.org/TR/html5/sections.html#the-h1-h2-h3-h4-h5-and-h6-elements</a>). Further in the spec's "4.4.11 Headings and sections" section, there are currently three examples of structuring a document about apples. </p> <p>If we follow the first specification, which states that heading elements "should represent headings for their sections," it seems the third apple example is the <em>most</em> correct structure (i.e., using h1 tags for the heading in each section and subsection). Using this logic it seems that the h2, h3, h4, h5, and h6 tags would be used rarely, if at all.</p> <p>This is what I'm wondering: should h2, h3, h4, h5, or h6 tags really be used if, in reality, they are basically marking up subsections? Does it not make more sense to use section tags to separate sections, each with their own header, rather than relying on h2, h3, etc. to start implicit sections? (The "Headers and sections" section also talks about the sections implied by using h2, h3, etc.)</p> <p>Perhaps it's my relational database knowledge causing a bias, but creating multiple header tags with numbers (h <strong>1</strong>, h <strong>2</strong>, h <strong>3</strong>) seems like bad practice, when technically they are each heading their own section or subsection.</p> <p>What are your thoughts?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload