English 中文(简体)
<nav>——这是否重要?
原标题:<nav> - Is it that important?
  • 时间:2011-08-04 10:27:50
  •  标签:
  • html

我注意到,如果你删除了<代码>nav的>要素,则链接清单与<代码>nav保持同。

因此,此处如何使用<代码>nav? 这给我带来了什么。

Yes,W3Schools.com mentions the following about nav:

<><>>>> 标签界定了一部分导航链接。

但是,正如我提到的那样,用什么来增加一个部分,即使消除其影响也会相同?

感谢。

最佳回答

认为这种超文本原意在成为一种标志性语言,使文件的数字化文本更容易查阅。 各种趋势将其从这一工具移至一种创造性工具,但“超”5似乎又回到了原来的概念。

<nav> adds a specific type of unordered list – a list that indicates it is specifically meant as navigation. What this is adding to you is a more universally identifiable document markup – whether you speak the language of the document or not, you can identify the regions to help you navigate. Yes, the screen readers, search engines, etc. have all been mentioned, but this is a human-friendly component as well. Looking solely at the source, one can identify how the document should be understood or organized. The potential benefit of this in document processing of all sorts (including PDF layout for publishers) is incalculable.

Remember that semantics carry the meaning of the words. You re marking up a portion of text so that text makes sense in context. <div> has no meaning, but <article>, <section> and <nav> all tell you what the text contained within the tags means to the overall document.

问题回答

虽然你通常会写上<代码><div id=“nav”>,但现在可以使用<代码><nav>。 它更具有主观性,几乎没有其他作用。

This will be helpful for mobile browsers and for other challenged environments where the user might want to have an easy jump at the navigation. It ll be easy for the browser to find the navigation that way.

Continue to use W3Schools as a reference source and you will go far ;)

Your question, might be better answered with taking a few examples... and then explaining why it matters... But the TL;DR version is to do with semantics.

  • <编码> 如果你有一段文字,那么,为什么你把它放在一个“带”;p> tag,你不需要。 你们可以同样习惯使用“灯塔”;Span>然后展示:一线,设定“差值”:10px,即“斜线”;二是使用和继续。

  • <编码> 这也是为什么你将内容部分划入“lt”;div>它把内容划分为有意义的领域。

确实如此。 这表明,如果你选择的话,对读者、搜索引擎,甚至你的国际空间站选择者进行筛查,即每一件进入该标的,均应视为导航区。

你们不需要,但肯定会 帮助把相关性分配给你的网页内容。

It adds semantics. A screen reader could be coded to skip over nav elements automatically, or a search engine bot could be coded not to include text in the nav element in the search result snippet.

现在,我知道,没有执行这些使用案例,但是,由于你可以只使用一刀,而不是四肢,实际上没有任何理由。





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签