diff options
| author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
|---|---|---|
| committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
| commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
| tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/html/element/article | |
| parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
| download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip | |
initial commit
Diffstat (limited to 'files/zh-cn/web/html/element/article')
| -rw-r--r-- | files/zh-cn/web/html/element/article/index.html | 139 |
1 files changed, 139 insertions, 0 deletions
diff --git a/files/zh-cn/web/html/element/article/index.html b/files/zh-cn/web/html/element/article/index.html new file mode 100644 index 0000000000..8261b6979b --- /dev/null +++ b/files/zh-cn/web/html/element/article/index.html @@ -0,0 +1,139 @@ +--- +title: <article> +slug: Web/HTML/Element/article +tags: + - HTML + - 元素 +translation_of: Web/HTML/Element/article +--- +<div>{{HTMLRef}}</div> + +<p><strong>HTML <code><article></code></strong>元素表示文档、页面、应用或网站中的独立结构,其意在成为可独立分配的或可复用的结构,如在发布中,它可能是论坛帖子、杂志或新闻文章、博客、用户提交的评论、交互式组件,或者其他独立的内容项目。</p> + +<div>{{EmbedInteractiveExample("pages/tabbed/article.html", "tabbed-standard")}}</div> + +<p class="hidden">The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone <a href="https://github.com/mdn/interactive-examples">https://github.com/mdn/interactive-examples </a> and send us a pull request.</p> + +<p>给定文档中可以包含多篇文章;例如,阅读器在博客上滚动时一个接一个地显示每篇文章的文本,每个帖子将包含在<code><article></code>元素中,可能包含一个或多个<code><section></code>。</p> + +<table class="properties"> + <tbody> + <tr> + <th scope="row"><dfn><a href="/en-US/docs/HTML/Content_categories" title="HTML/Content_categories">内容分类</a></dfn></th> + <td><a href="/en-US/docs/HTML/Content_categories#Flow_content">Flow content</a>, sectioning content, palpable content.</td> + </tr> + <tr> + <th scope="row">允许的内容</th> + <td><a href="/en-US/docs/HTML/Content_categories#Flow_content">Flow content</a>.</td> + </tr> + <tr> + <th scope="row"><dfn>标记省略</dfn></th> + <td>{{no_tag_omission}}</td> + </tr> + <tr> + <th scope="row">允许的父元素</th> + <td>所有接受 <a href="/en-US/docs/HTML/Content_categories#Flow_content">Flow content</a>的元素。注意<code><article></code>元素不能成为{{HTMLElement("address")}}元素的子元素。</td> + </tr> + <tr> + <th scope="row">允许的 ARIA roles</th> + <td>{{ARIARole("application")}}, {{ARIARole("document")}}, {{ARIARole("feed")}}, {{ARIARole("main")}}, {{ARIARole("presentation")}}, {{ARIARole("region")}}</td> + </tr> + <tr> + <th scope="row">DOM 实例</th> + <td>{{domxref("HTMLElement")}}</td> + </tr> + </tbody> +</table> + +<h2 id="属性">属性</h2> + +<p>此元素只具有<a href="https://developer.mozilla.org/en-US/docs/HTML/Global_attributes">全局属性</a>。</p> + +<h2 id="使用说明">使用说明</h2> + +<ul> + <li>每个<code><article></code>,通常包括标题(<h1> - <h6>元素)作为<code><article></code>元素的子元素。</li> + <li>当<code><article></code>元素嵌套使用时,则该元素代表与外层元素有关的文章。例如,代表博客评论的<code><article></code>元素可嵌套在代表博客文章的<code><article></code>元素中。</li> + <li><code><article></code>元素的作者信息可通过{{HTMLElement("address")}}元素提供,但是不适用于嵌套的<code><article></code>元素。</li> + <li> + <p><code><article></code>元素的发布日期和时间可通过{{HTMLElement("time")}}元素的{{htmlattrxref("pubdate", "time")}}属性表示。</p> + </li> + <li> + <p>可以使用{{HTMLElement("time")}} 元素的{{htmlattrxref("datetime", "time")}}属性来描述<code><article></code>元素的发布日期和时间。请注意{{HTMLElement("time")}}的<em>{{htmlattrxref("pubdate", "time")}} </em>属性不再是<em>{{glossary("W3C")}} </em> <em>{{glossary("HTML5")}}</em>标准。</p> + </li> +</ul> + +<h2 id="示例">示例</h2> + +<pre><code><article class="film_review"> + <header> + <h2>Jurassic Park</h2> + </header> + <section class="main_review"> + <p>Dinos were great!</p> + </section> + <section class="user_reviews"> + <article class="user_review"> + <p>Way too scary for me.</p> + <footer> + <p> + Posted on + <time datetime="2015-05-16 19:00">May 16</time> + by Lisa. + </p> + </footer> + </article> + <article class="user_review"> + <p>I agree, dinos are my favorite.</p> + <footer> + <p> + Posted on + <time datetime="2015-05-17 19:00">May 17</time> + by Tom. + </p> + </footer> + </article> + </section> + <footer> + <p> + Posted on + <time datetime="2015-05-15 19:00">May 15</time> + by Staff. + </p> + </footer> +</article></code></pre> + +<h2 id="Specifications" name="Specifications">规范</h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">规范</th> + <th scope="col">状态</th> + <th scope="col">注释</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{SpecName('HTML WHATWG', 'sections.html#the-article-element', '<article>')}}</td> + <td>{{Spec2('HTML WHATWG')}}</td> + <td></td> + </tr> + <tr> + <td>{{SpecName('HTML5 W3C', 'sections.html#the-article-element', '<article>')}}</td> + <td>{{Spec2('HTML5 W3C')}}</td> + <td></td> + </tr> + </tbody> +</table> + +<h2 id="浏览器兼容">浏览器兼容</h2> + +<p>{{Compat("html.elements.article")}}</p> + +<h2 id="相关文章">相关文章</h2> + +<ul> + <li>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")}}</li> + <li class="last"><a class="deki-ns current" href="/en-US/docs/Sections_and_Outlines_of_an_HTML5_document" title="Sections and Outlines of an HTML5 document">Sections and outlines of an HTML5 document</a>.</li> +</ul> |
