如何正确<section>和<article>多主题博客索引?</article> </section>

时间:2014-09-05 18:56:28

标签: html5

如果我有一个博客索引页面,其中包含新闻,评论和视频,每个页面都在他们自己的“&#39;”部分中。将每组摘录定义为自己的部分是有意义的,例如:

<section id="news">
<h2>Section Title</h2>
<article> ... an article excerpt here ... </article>
<article> ... an article excerpt here ... </article>
<article> ... an article excerpt here ... </article>
</section>

<section id="reviews">
<h2>Section Title</h2>
<article> ... an article excerpt here ... </article>
<article> ... an article excerpt here ... </article>
<article> ... an article excerpt here ... </article>
</section>

<section id="videos">
<h2>Section Title</h2>
<article> ... an article excerpt here ... </article>
<article> ... an article excerpt here ... </article>
<article> ... an article excerpt here ... </article>
</section>

1 个答案:

答案 0 :(得分:1)

HTML5 specification说:

  

section元素表示文档或应用程序的通用部分。在这种情况下,一节是内容的主题分组。

     

article元素表示文档,页面,应用程序或站点中的完整或自包含的组合,并且原则上可独立分发或可重用,例如,在联合组织。

因此,使用<article><section>构建内容的方式完全符合规范。