HTML5 每级标题的副标题 mark-up,即 h1 到 h6

HTML5 subtitle mark-up for every level of headings, ie, h1 to h6

包括 WordPress 官方模板,有很多资源解释了如何编写 "h1" 和 "h2" 代码,用 "header" 标签包装以包含副标题作为 "p" 标签.

例如,

  <main>  
    <header>
      <h1>The Title For The Site</h1>
      <p>The subtitle goes here</p>
    </header>
    ...
 </main>

或存档页面:

  <main>  
    <header>
      <h1>The Title For The Site</h1>
      <p>The subtitle goes here</p>
    </header>
    <article>
      <header>
        <h1>The Title Of An Article</h1>
        <p>The subtitle for the article</p>
      </header>
      ...
    </article>
    ...
 </main>

那么问题来了: 如果我还需要这些级别的字幕,那么其他级别的 h3 到 h6 标题是什么?

在语义上是否可以 mark-up 如:

      <main>  
        <header>
          <h1>The Title For The Site</h1>
          <p>The subtitle goes here</p>
        </header>
        <p>Lorem ipsum dolor sit amet, consectetur ... dignissim.</p>

    <header>
      <h3>Fusce rutrum</h3>
      <p>Vestibulum commodo gravida tortor</p>
    </header>
    <p>....</p>

    <header>
      <h4>Praesent eget</h4>
      <p> Maecenas malesuada vel lectus</p>
    </header>
    <p>....</p>
    ...
 </main>

请指教!提前致谢。

是的,没错。在这种情况下,标题等级不是相关差异。重要的是您不要为副标题使用其他标题元素。

另见 HTML 5.1 规范:Subheadings, subtitles, alternative titles and taglines