Why does the <nav> tag use a list?

How come an unordered list is used inside of the navigation element?




      <li><a href="#home">Home</a></li>

      <li><a href="#about">About</a></li>      




As shown here.

i am not sure why, but this may be because items to navigate websites are listed, and navigation bars sometimes use unordered lists to show the different aspects of them

1 Like

A nav tag is basically used for a menu. It’s a semantic element introduced in HTML5 to better inform web browsers and devices of what the element is for rather than creating a class called nav.

If you think about the nav it will either display horizontally or vertically so a list is perfect for the job. Doesn’t necessarily matter what kind of list as long as you style it correctly. Typically removing the bullet or numbers and replacing them with icons or nothing at all.