html - HTML5的<article>标签只能在博客中使用吗?

标签 html

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.

My favourite resource about this - HTML5Doctor

关于html - HTML5的<article>标签只能在博客中使用吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5577044/

相关文章:

html - 当 DIV 处于溢出状态时垂直滚动条消失(仅限 I.E.)

javascript - 按图像过滤 不想显示所有图像

javascript - 选择带有 DOM 的 div 内容,但没有子元素

javascript - 当用户按 Enter 键时,它将下拉菜单内容和文本字段数据更改为默认值

Javascript 秒表自动启动

javascript - 使用node.js和backbone.js将单页面应用程序转换为多页面网站

javascript - jQuery:如何实现 slider (旋转木马)的 Controller ?

html - 如何使用 HTML 和 CSS 加载一张图片并使用它两次?没有JS

html - 如何将图像添加到html中的超链接?

javascript - SVG getPointAtLength() 返回无效坐标