【发布时间】:2015-03-28 15:32:21
【问题描述】:
作为与another question 相关的项目的一部分,我需要在语义 HTML5 中标记嵌套文章。有一篇杂志文章包含不同作者的一些短文以及一些编辑 cmets。在当前的 HTML4 版本中,它看起来像这样:
<div id="article">
<h1>Main heading - a collection of texts</h1>
<p id="intro">
A general introduction to the whole collection by the editor.
</p>
<p class="preamble">
A few words from the editor about the first text.
</p>
<h2>First text heading</h2>
<p>First text. Lorem ipsum ...</p>
<p class="author">
Name of author of first text.
</p>
<div>*</div>
<p class="preamble">
A few words from the editor about the second text.
</p>
<h2>Second text heading</h2>
<p>Second text. Dolorem ipsum ...</p>
<p class="author">
Name of author of second text.
</p>
<p id="postscript">
Some final words about the whole collection by the editor.
</p>
<div>
我一直在考虑在 HTML5 中使用类似的东西,但有些元素我根本不知道什么是最好的:
<article>
<header>
<h1>Main heading</h1>
<ELEMENT>
General introduction
</ELEMENT>
</header>
<article>
<header>
<ELEMENT>
Preamble
</ELEMENT>
<h2>
Article heading
</h2>
</header>
<p>
Article text
</p>
<ELEMENT>
Name of author
</ELEMENT>
</article>
<div>*</div>
<article>
Second article ...
</article>
<ELEMENT>
Postscript by editor
</ELEMENT>
</article>
我应该在各种介绍和后记中使用带有类名的p 元素,还是应该使用aside 元素?还有什么?关于作者姓名的同样问题。 address 元素似乎并不完全正确。 footer 中可能还有其他元素 (?)?
编辑:偶尔也有一些图像,并且在文章末尾以小字形式提到了摄影师(“照片:John Doe。”)。 footer中的元素x?
【问题讨论】:
标签: html semantic-markup article