大网数据广告活动
网站运营与故障问答

Should we use <nav> for global navigation since it is sectioning content?

· 52CE 我爱测

Background In term of SEO, <h1> should be used as page specific content only and we should avoid to use it for site logotype. So, a current homepage structure should be something like: <body> <header> <p><img id="logo"> <nav> <ul…

问题原文

原帖链接 · Fong-Wan Chau · CC BY-SA 3.0

Background

In term of SEO, <h1> should be used as page specific content only and we should avoid to use it for site logotype. So, a current homepage structure should be something like:

<body>
<header>
  <p><img id="logo">
  <nav>
    <ul></ul>
  </nav>
</header>
<main>
  <h1>Homepage</h1>
  <!-- Content -->
</main>
<footer>
  <nav>
    <ul></ul>
  </nav>
  <p>Copyright
</footer>

But the above code gave this outline in HTML5 outliner:

  1. Homepage
    1. Untitled Section (nav)
    2. Untitled Section (nav)

The problem

Since <nav> is sectioning content, should we avoid the use of that for global navigation because logically it is not in-page navigation?

已采纳解答

原帖链接 · marcanuy · CC BY-SA 3.0

In html5 the nav element should be used to represent a section of a page that links to

  • other pages or
  • to parts within the page

So depending what kind of links you are specifying in the footer section you might avoid inserting them within a nav element:

Not all groups of links on a page need to be in a nav element — the element is primarily intended for sections that consist of major navigation blocks. In particular, it is common for footers to have a short list of links to various pages of a site, such as the terms of service, the home page, and a copyright page. The footer element alone is sufficient for such cases; while a nav element can be used in such cases, it is usually unnecessary

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2016-08-17)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。