一个好的做法是将<header>
标记放在<section>
标记内吗?
我知道它在<header>
,<article>
,<aside>
,<footer>
内是正确的。
<section>
用于分隔我们网页的不同主题,通常我们可能会在其中找到<article>
(可能是<header>
)。然后我怀疑将<header>
标记用于<section>
。
例如。
<body>
<header>
<hgroup>
<h1>hello</h1>
<h2>world</h2>
</hgroup>
</header>
<section>
<header>Total news</header>
<article>
<header><h1>News</h1></header>
<section>
<header>Daily news</header>
<article>
<header><h2>News 1 title</h2></header>
<p>news 1</p>
</article>
<article>
<header><h2>News 2 title</h2></header>
<p>news 2</p>
</article>
</section>
</article>
</section>
<section>
<header><h1>Another section</h1></header>
<article>
<p>Content of another section</p>
</article>
</section>
<footer>
<p>Copyright</p>
</footer>
</body>
答案 0 :(得分:0)
您的第一个标题<header>Total news</header>
将是一个简单的<H1>
。
<header><h1>News</h1></header>
将为<hgroup><h1>News</h1></hgroup>
(在此示例中,您根本不需要该容器)
您还应该考虑使用标签。您不必仅仅因为它是“正确的顺序”而使用所有这些。您使用的标签越少越好。
答案 1 :(得分:0)
将<head>
标记放在<head>
标记内是完全合适的,甚至根据本文http://www.anthonycalzadilla.com/2010/08/html5-section-aside-header-nav-footer-elements-not-as-obvious-as-they-sound/建议使用。
<article>
标记也可以根据本文http://html5doctor.com/the-article-element/放在<section>
标记内。