虽然我真的应该知道这一点,但我担心我不能完全理解.阅读过不同的文章,阅读书籍并与其他人交谈后,我仍然不太了解HTML5的正确结构section.h1在每个section和/或中都有一个标签是否合适article?是否新的section或article构成开始h1到h2再次处理?
我的印象是每个"块"应该被允许它自己的"标题"结构.
例如,这是正确的HTML5吗?:
<!doctype html>
<html>
<head>
<title>
<!-- etc. etc. -->
<body>
<section> <!-- two or more <articles> within this section, both using <h1> tags -->
<h1>Here is a section with articles in</h1>
<article>
<h1>Heading</h1>
<h2>sub heading</h2>
<p>A paragraph>
</article>
<article>
<h1>Heading</h1>
<h2>sub heading</h2>
<p>A paragraph</p>
</article>
...
</section>
<section> <!-- two or more <articles> within this additional section, both using <h1> tags -->
<h1>Here is a section with articles in</h1>
<article>
<h1>Heading</h1>
<h2>sub heading</h2>
<p>A paragraph>
</article>
<article>
<h1>Heading</h1>
<h2>sub heading</h2>
<p>A paragraph</p>
</article>
...
</section>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
由于 s中的每一对h1和元素分别代表一个标题和一个副标题,因此您需要将这对元素在h2articleheaderarticle为每篇文章生成正确的文档大纲。
除此之外,您各部分的标题结构看起来不错。