[英]HTML5 Structure - <article>, <section> and <div> usage
[英]HTML5 structure and headings in section or article
雖然我真的應該知道這一點,但我擔心我不能完全理解。 閱讀過不同的文章,閱讀書籍並與其他人交談后,我仍然不太了解HTML5 section
的正確結構。 在每個section
和/或article
都有一個h1
標簽是否合適? 新的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>
由於每對h1
和h2
在你的元素article
小號分別代表一個標題和副標題,你需要組對到自己的header
的內article
,以產生每篇文章一個適當的文檔大綱。
除此之外,您的部分的標題結構似乎很好。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.