标题标签可以包含超过 1 个导航标签吗?
例如,我在页面顶部有一个网络导航菜单,其中包含指向整个网络站点的链接,而我的主导航包含指向该站点的导航。这两个导航项可以位于 html5 中的同一标头标记中吗?所以我会有这样的东西,
<header>
<nav id="nav_network"></nav>
logo and stuff
<nav id="nav_site"></nav>
</header>
这有效吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
验证器可以这样做:
http://validator.w3.org/check
(只要您在文档中包含
head
和title
)但通常情况下,您会将
nav
放在header
之外。Header
更像是标题、徽标和搜索表单。http://dev.w3.org/html5/spec/Overview .html#the-header-element
更多信息:http://html5doctor.com/the -标题元素/
This is fine by the validator:
http://validator.w3.org/check
(As long as you include a
head
and atitle
in the doc)Usually, though, you would place the
nav
outside theheader
.Header
is more like the title, logo, and a search form.http://dev.w3.org/html5/spec/Overview.html#the-header-element
More here: http://html5doctor.com/the-header-element/
在标题中使用多个导航没有任何问题,它完美没问题。
There is nothing wrong in using Multiple nav in header, it is perfectly fine.
是的,您可以插入多个元素;如果您基本上是在询问可用性,那么这就是答案。您可以使用多个元素,浏览器将完美地读取您的代码,因为该元素在浏览器中被读取为一个元素,并且它们之间没有区别。
但从搜索引擎优化的角度来看,不建议这样做,因为它会告诉搜索引擎在哪里可以找到您的导航菜单。因此,您的网站上应该只使用一个导航栏。
简而言之,您可以这样做,但不建议这样做。
Yes, you can insert more than one element; that is the answer if you are basically asking about the availability. You can use more than one element, and the browser will read your code perfectly since the element is read as a element in your browser, and there is no difference between them.
But as an SEO wise it is not recommended because the is telling search engines where they can find your navigation menu. So, it is supposed to use only one navigation bar on your website.
Briefly, you can do that, but it is not recommended.