Home  >  Article  >  Web Front-end  >  How to use nav tag properly in html5?

How to use nav tag properly in html5?

黄舟
黄舟Original
2017-06-29 14:23:413009browse

html5Is it reasonable to use the nav tag in this way?

<nav>
<li><a href="#">1111111111111</a></li>
<li><a href="#">222222222</a></li>
<li><a href="#">333333333333</a></li>
<li><a href="#">44444444</a></li>
</nav>

Can the nav tag in hmtl5 be used as above? Is it reasonable to use it this way? Please give advice.

It should be like this

<nav>
  <ul>
    <li><a href="#">1111111111111</a></li>
    <li><a href="#">222222222</a></li>
    <li><a href="#">333333333333</a></li>
    <li><a href="#">44444444</a></li>
  </ul>
</nav>

Why do you have to add UL? I think if you use UL, otherthe outer nav can be omitted. This does not belong More code? Is it necessary to write so many layers? If it doesn't have that effect, a label will do.

If you say that ul can be removed, then the code you used to write can be written as follows

<div>
  <li></li>
  <li></li>
</div>

First, the structure of the list is like this: ff6d136ddc5fdfeffaf53ff6ee95f18525edfb22a4f469ecb59f1190150159c62867e861ba23559b572f230426ab14ea929d1f5ca49e04fdcb27f9465b944689If there is no ul, is it still called a list?

The above is the detailed content of How to use nav tag properly in html5?. 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