diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/html/element/nav/index.html | |
parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip |
initial commit
Diffstat (limited to 'files/zh-cn/web/html/element/nav/index.html')
-rw-r--r-- | files/zh-cn/web/html/element/nav/index.html | 107 |
1 files changed, 107 insertions, 0 deletions
diff --git a/files/zh-cn/web/html/element/nav/index.html b/files/zh-cn/web/html/element/nav/index.html new file mode 100644 index 0000000000..b40ac7921a --- /dev/null +++ b/files/zh-cn/web/html/element/nav/index.html @@ -0,0 +1,107 @@ +--- +title: <nav> +slug: Web/HTML/Element/nav +tags: + - HTML + - 元素 + - 导航 + - 链接 +translation_of: Web/HTML/Element/nav +--- +<div>{{HTMLRef}}</div> + +<p><strong>HTML <code><nav></code>元素</strong>表示页面的一部分,其目的是在当前文档或其他文档中提供导航链接。导航部分的常见示例是菜单,目录和索引。</p> + +<div>{{EmbedInteractiveExample("pages/tabbed/nav.html", "tabbed-standard")}}</div> + +<p class="hidden">The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone <a href="https://github.com/mdn/interactive-examples">https://github.com/mdn/interactive-examples </a> and send us a pull request.</p> + +<table class="properties"> + <tbody> + <tr> + <th scope="row"><dfn><a href="/zh-CN/docs/HTML/Content_categories" title="HTML/Content_categories">内容分类</a></dfn></th> + <td><a href="/zh-CN/docs/HTML/Content_categories#Flow_content" title="HTML/Content categories#Flow content">流式内容</a>, <a href="/zh-CN/docs/HTML/Content_categories#Sectioning_content" title="HTML/Content categories#Sectioning_content">区块内容</a>, 可视的内容.</td> + </tr> + <tr> + <th scope="row"><dfn>允许的内容</dfn></th> + <td><a href="/zh-CN/docs/HTML/Content_categories#Flow_content" title="HTML/Content categories#Flow content">流式内容</a>.</td> + </tr> + <tr> + <th scope="row"><dfn>忽略的标记</dfn></th> + <td>{{no_tag_omission}}</td> + </tr> + <tr> + <th scope="row"><dfn>允许的父元素</dfn></th> + <td>所有允许<a href="/zh-CN/docs/HTML/Content_categories#Flow_content" title="HTML/Content categories#Flow content">流式内容</a>的元素</td> + </tr> + <tr> + <th scope="row"><dfn>允许的</dfn> ARIA roles</th> + <td>None</td> + </tr> + <tr> + <th scope="row"><dfn>DOM 接口</dfn></th> + <td>{{domxref("HTMLElement")}}</td> + </tr> + </tbody> +</table> + +<h2 id="属性">属性</h2> + +<p><span style="line-height: 21px;">这个元素只包含</span><a href="https://developer.mozilla.org/zh-CN/docs/HTML/Global_attributes" style="line-height: 21px;" title="HTML/Global attributes">全局属性</a><span style="line-height: 21px;">.</span></p> + +<h2 id="使用说明"><em>使用说明</em></h2> + +<ul> + <li>并不是所有的链接都必须使用<code><nav></code>元素,它只用来将一些热门的链接放入导航栏,例如{{HTMLElement("footer")}}元素就常用来在页面底部包含一个不常用到,没必要加入{{HTMLElement("nav")}}的链接列表.</li> + <li>一个网页也可能含有多个{{HTMLElement("nav")}}元素,例如一个是网站内的导航列表,另一个是本页面内的导航列表.</li> + <li>对于屏幕阅读障碍的人,可以使用这个元素来确定是否忽略初始内容.</li> +</ul> + +<h2 id="示例">示例</h2> + +<pre class="brush:xml"><nav> + <ul> + <li><a href="#">Home</a></li> + <li><a href="#">About</a></li> + <li><a href="#">Contact</a></li> + </ul> +</nav> +</pre> + +<h2 id="Specifications" name="Specifications">规范</h2> + +<table class="standard-table" style="height: 137px; width: 603px;"> + <thead> + <tr> + <th scope="col">规范</th> + <th scope="col">状态</th> + <th scope="col">注释</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{SpecName('HTML WHATWG', 'sections.html#the-nav-element', '<nav>')}}</td> + <td>{{Spec2('HTML WHATWG')}}</td> + <td></td> + </tr> + <tr> + <td>{{SpecName('HTML5 W3C', 'sections.html#the-nav-element', '<nav>')}}</td> + <td>{{Spec2('HTML5 W3C')}}</td> + <td></td> + </tr> + </tbody> +</table> + +<h2 id="浏览器兼容">浏览器兼容</h2> + +<p>{{Compat("html.elements.nav")}}</p> + +<h2 id="更多">更多</h2> + +<ul> + <li>其他部分相关元素: {{HTMLElement("body")}}, {{HTMLElement("article")}}, {{HTMLElement("section")}}, {{HTMLElement("aside")}}, {{HTMLElement("h1")}}, {{HTMLElement("h2")}}, {{HTMLElement("h3")}}, {{HTMLElement("h4")}}, {{HTMLElement("h5")}}, {{HTMLElement("h6")}}, {{HTMLElement("hgroup")}}, {{HTMLElement("header")}}, {{HTMLElement("footer")}}, {{HTMLElement("address")}};</li> + <li class="last"><a class="deki-ns current" href="/zh-CN/docs/Sections_and_Outlines_of_an_HTML5_document" title="Sections and Outlines of an HTML5 document">HTML5的文档节段和纲要</a>.</li> + <li><a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/Navigation_Role">ARIA: Navigation role</a></li> +</ul> + +<div></div> |