HTML5的article
标签只能在博客中使用吗?它只适用于博客文章吗?不是用于博客的网站内容部分吗?
一般我用
<div id="content">
<h2> title </h2>
<p> content </p>
</div>
我应该用 article
替换 div
吗?
<article id="content">
<h2> title </h2>
<p> content </p>
</article>
或
<div id="content">
<article>
<h2> title </h2>
<p> content </p>
</article>
</div>
最佳答案
来自spec :
The article element represents a component of a page that consists of a self-contained composition in a document, page, application, or site and that is intended to be independently distributable or reusable, e.g. in syndication. This could be a forum post, a magazine or newspaper article, a blog entry, a user-submitted comment, an interactive widget or gadget, or any other independent item of content.
所以我想这在很大程度上取决于 #content
包含的内容。如果它只包含那个特定的 article
(或与那个 article
相关的东西,比如嵌套为进一步的 article
的评论),你不需要div
.
关于html - HTML5的<article>标签只能在博客中使用吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5577044/