问题
for example, I have a network nav menu at the top of the page which contains links to sites across the network and my main nav contains navigation to this site. Can both of these nav items be in the same header tag in html5? So I would have something like
<header>
<nav id="nav_network"></nav>
logo and stuff
<nav id="nav_site"></nav>
</header>
Is this valid?
回答1:
This is fine by the validator:
http://validator.w3.org/check
(As long as you include a head
and a title
in the doc)
Usually, though, you would place the nav
outside the header
.
Header
is more like the title, logo, and a search form.
A header element is intended to usually contain the section's heading (an h1–h6 element or an hgroup element), but this is not required. The header element can also be used to wrap a section's table of contents, a search form, or any relevant logos.
http://dev.w3.org/html5/spec/Overview.html#the-header-element
More here: http://html5doctor.com/the-header-element/
回答2:
There is nothing wrong in using Multiple nav in header, it is perfectly fine.
来源:https://stackoverflow.com/questions/7321050/can-the-header-tag-contain-more-than-1-nav-tag