<article>
元素表示文档、页面、应用或网站中的独立结构,其意在成为可独立分配的或可复用的结构,如在发布中,它可能是论坛帖子、杂志或新闻文章、博客、用户提交的评论、交互式组件,或者其他独立的内容项目。
使用说明:
- 当
<article>
元素嵌套使用时,则该元素代表与外层元素有关的文章。例如,代表博客评论的<article>
元素可嵌套在代表博客文章的<article>
元素中。 <article>
元素的作者信息可通过{{HTMLElement("address")}}元素提供,但是不适用于嵌套的<article>
元素。-
<article>
元素的发布日期和时间可通过{{HTMLElement("time")}}元素的{{htmlattrxref("pubdate", "time")}}属性表示。
- 内容分类 Flow content, sectioning content, palpable content.
- 许可内容Flow content.
- 标记省略 {{no_tag_omission}}
- 父元素所有接受 flow content的元素。注意<article>元素不能成为{{HTMLElement("address")}}元素的子元素。
- DOM interface {{domxref("HTMLElement")}}
属性
只具有全局属性。
示例
<article> <h4>A really awesome article</h4> <p>Lots of awesome text.</p> </article>
标准
Specification | Status | Comment |
---|---|---|
{{SpecName('HTML WHATWG', 'sections.html#the-article-element', '<article>')}} | {{Spec2('HTML WHATWG')}} | |
{{SpecName('HTML5 W3C', 'sections.html#the-article-element', '<article>')}} | {{Spec2('HTML5 W3C')}} |
浏览器兼容
{{CompatibilityTable}}
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | 5 | {{CompatGeckoDesktop("2.0")}} | 9.0 | 11.10 | 4.1 |
Feature | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Basic support | 2.2 | {{CompatGeckoMobile("2.0")}} | 9.0 | 11.0 | 5.0 (iOS 4.2) |
相关文章
- Others section-related elements: {{HTMLElement("body")}}, {{HTMLElement("nav")}}, {{HTMLElement("section")}}, {{HTMLElement("aside")}}, {{HTMLElement("h1")}}, {{HTMLElement("h2")}}, {{HTMLElement("h3")}}, {{HTMLElement("h4")}}, {{HTMLElement("h5")}}, {{HTMLElement("h6")}}, {{HTMLElement("hgroup")}}, {{HTMLElement("header")}}, {{HTMLElement("footer")}}, {{HTMLElement("address")}}
- Sections and outlines of an HTML5 document.
{{ HTMLRef }}