虽然我真的应该知道这一点,但我担心我不能完全理解.阅读过不同的文章,阅读书籍并与其他人交谈后,我仍然不太了解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
和元素分别代表一个标题和一个副标题,因此您需要将这对元素在h2
article
header
article
为每篇文章生成正确的文档大纲。
除此之外,您各部分的标题结构看起来不错。
归档时间: |
|
查看次数: |
269 次 |
最近记录: |