Home  >  Article  >  Web Front-end  >  html: What does the nav tag actually do?

html: What does the nav tag actually do?

黄舟
黄舟Original
2017-06-29 14:21:233018browse

I searched for this tag on the Internet to define the link part of Navigation, but I didn’t see any impact even if I removed it. I think I haven’t reached the point where it is useful yet. Please tell me what unique function it has? In addition, when learning HTML, I want to see the unique functions of each tag, but I often feel that some tags are useless, some cannot be seen from the effect, or the tags have similar functions, how can I remove them? What about discernment and experience?

is just a tag used to enhance semantics in html5. Semantic is beneficial to the SEO of web pages.

Just for semantics. May be helpful for seo. Similar to p, h1, font, but some tag browsers add default styles.

html just defines the structure or meaning of the web page, and the specific performance effect is the task of css.
So about c787b9a589a3ece771e842a6176cf8e9 you only need to know that it is only navigation in the sense

Hello, it is similar to header and footer. It is just for people to easily identify the document structure. There is no special style on css.

This is the new tag in html5:

<nav><a>首页</a><a>文章</a><a>关于</a></nav>

The usage is the same as writing with div before:

<div class="nav"><a>首页</a><a>文章</a><a>关于</a></div>

It’s just that using nav is more conducive to code reading and

search engine recognition. Of course, it is right to continue using divs, but the code is full of divs. You need more information to know what this div is for. For example, in the above code, after adding a class=nav, I realized that this code is navigation

It is a common thing in web pages, and it increases the semantics of HTML

html5. A semantic tag added by itself

Semantic tags are highly readable, easy to encapsulate and maintain, and are also beneficial to seo

The above is the detailed content of html: What does the nav tag actually do?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn