I used NAV tags in HTML and it doesn't work as I wanted

nav tag in html
in html, what does the <aside> element define?
section tag html
html5 navigation examples
nav vs div
html tags
header html
which html element is used to specify a header for a document or section?

This is my css and my html5 to make a website but the navigation bar doesn't lying in the row.

<nav>
  <ul>
    <div>
      <center>
        <ul class="menu">
          <li>
            <a href="Home.html"> <button>HOME</button> </a>
          </li>
          <li><a href="Gymset.html"><button>GYM SETS</button></a>
            <ul class="menu-con">
              <li><a href="#"><button>SET TẬP GYM TRONG NHÀ</a>
                <ul class="menu-con2">
                  <li><a href="#"><button>TẠ TẬP TAY</button></a></li>
                  <li><a href="#"><button>TẠ TẬP CHÂN</button></a></li>
                </ul>
              </li>
              <li><a href="#"><button>SET TẬP GYM NGOÀI TRỜI</button></a></li>
              <li><a href="#"><button>SET TẬP AN TOÀN</button></a></li>
            </ul>
          </li>
          <li><a href="Dotap.html"><button>Đồ tập</button></a></li>
          <li><a href="Gio hang.html"><button>Giỏ hàng</button></a></li>
          <li><a href="Lienhe.html"><button>Liên hệ</button></a></li>
      </center>
    </div>
    </ul>
</nav>

<nav> is a simple element just like a <div>. It's considered best practice to use a nav tag when the content of your element is a navigation component. It's only semantic, and doesn't have different styling.

If you want to create an horizontal navigation you can use a list and style it so each li will float left and you'll probably want to remove the list-style.

ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

li {
    float: left;
}

It's also recommended not to use button inside a <a>, you can style your <a> tag to look like a button. Here's an example:

ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background-color: #bada55;
}

li {
  float: left;
}

li a {
  display: block;
  color: white;
  text-align: center;
  padding: 8px;
  text-decoration: none;
}

li a:hover {
  background-color: #585858;
}
<nav>
  <ul class="menu">
    <li>
      <a href="Home.html"> HOME </a>
    </li>
    <li><a href="Gymset.html">GYM SETS</a>
      <ul class="menu-con">
        <li><a href="#">TRONG NHÀ</a></li>
        <li><a href="#">NGOÀI TRỜI</a></li>
        <li><a href="#">TOÀN</a></li>
      </ul>
    </li>
    <li><a href="Dotap.html">Đồ tập</a></li>
    <li><a href="Gio hang.html">Giỏ hàng</a></li>
    <li><a href="Lienhe.html">Liên hệ</a></li>
  </ul>
</nav>

<nav>: The Navigation Section element, The <nav> tag is one of the HTML5 elements. It is used to specify a block of navigation links, either within the current document or to other documents. Examples  This HTML tutorial explains how to use the HTML element called the nav tag with syntax and examples. The HTML nav tag is an HTML 5 element that defines a section with navigation links in the HTML document (also called nav element).

You can follow this code

<html>
<style>
    body{
        color: white;
    }

    ul{
        margin: 0;
        padding: 0;
        list-style: none;
    }

    ul li{
        float: left;
        width: 200px;
        height: fit-content;
        background: black;
        text-align: center;
        font-size: 20px;
        margin-right: 10px;
    }

    ul li a{
        color: white;
        display: block;
        text-decoration: none;
    }

    ul li a:hover{
        background-color: green;
    }

    ul li ul li{
        display: none;
    }

    ul li:hover ul li{
        display: block;
    }

</style>
<body>
                <ul>
                    <li>
                        <a href="...">HOME</a>
                    </li>
                    <li>
                        <a>GYM SETS</a>
                        <ul>
                            <li><a>SET TẬP GYM TRONG NHÀ</a>
                            </li>
                            <li><a>SET TẬP GYM NGOÀI TRỜI</a></li>
                            <li><a>SET TẬP AN TOÀN</a></li>
                        </ul>
                    </li>
                    <li>
                        <a href="...">Đồ tập</a>
                    </li>
                    <li>
                        <a href="...">Giỏ hàng</a>
                    </li>
                    <li>
                        <a href="...">Liên hệ</a>
                    </li>
                </ul>
</body>
</html>

HTML nav Tag, One of the new elements for HTML 5 is the <nav> element which the nav element that doesn't allow background images to be used with it? Building Navigation Menus. In HTML 4, coding a horizontal navigation menu required both HTML and CSS code. The list of links would have to be coded within the ul element, and then a style applied to create the horizontal layout. nav is a new element that makes it much easier to create a navigation menu. It creates a neat, horizontal menu of text links, and helps screen reading software to correctly identify the primary navigation areas in a document.

May be this can works for you, also if you're building a responsive site, you need to learn more about mobile first and change some of css rules, adding media querys...

list-style: none, remove the default style for lists.

tag is deprecated but you can still use it, but for better practice you can use display: flex; and justify-content-center;

A Complete Guide to Flexbox

You can add several submenus like this way...

* {
            padding: 0;
            margin: 0;
        }

        nav {
            background: #111;
        }

        ol,
        ul {
            list-style: none;
        }
        .menu {
            display: flex;
            justify-content: center;
        }
        .menu li a {
            background: #111;
            color: #ffffff;
            text-decoration: none;
            padding: 20px;
            display: block;
        }

        .menu li a:hover {
            background: green;
        }

        .menu li ul {
            display: none;
            position: absolute;
            min-width: 140px;
        }

        .menu li:hover>ul {
            display: block;
        }

        .menu li ul li {
            position: relative;
        }

        .menu li ul li ul {
            right: -140px;
            top: 0;
        }
    <nav>
        <ul class="menu">
            <li>
                <a href="Home.html"> HOME </a>
            </li>
            <li>
                <a href="Gymset.html">GYM SETS</a>
                <ul>
                    <li><a href="#">TRONG NHÀ</a></li>
                    <li><a href="#">NGOÀI TRỜI</a></li>
                    <li><a href="#">TOÀN</a></li>
                </ul>
            </li>
            <li><a href="Dotap.html">Đồ tập</a>
                <ul>
                    <li><a href="#">TRONG NHÀ</a></li>
                    <li><a href="#">NGOÀI TRỜI</a></li>
                    <li><a href="#">TOÀN</a>
                        <ul>
                            <li><a href="#">TRONG NHÀ</a></li>
                            <li><a href="#">NGOÀI TRỜI</a></li>
                            <li><a href="#">TOÀN</a>
                                <ul>
                                    <li><a href="#">TRONG NHÀ</a></li>
                                    <li><a href="#">NGOÀI TRỜI</a></li>
                                    <li><a href="#">TOÀN</a>
                                        <ul>
                                            <li><a href="#">TRONG NHÀ</a></li>
                                            <li><a href="#">NGOÀI TRỜI</a></li>
                                            <li><a href="#">TOÀN</a></li>
                                        </ul>
                                    </li>
                                </ul>
                            </li>
                        </ul>
                    </li>
                </ul>
            </li>
            <li><a href="Gio hang.html">Giỏ hàng</a></li>
            <li><a href="Lienhe.html">Liên hệ</a></li>
        </ul>
    </nav>

Semantic navigation with the nav element, For example, the <nav> tag can be used to determine whether to accept [My example] shows that tag doesn't add any special meaning to its  The <nav> element is for "major navigation blocks"*. It can go in the header or article tags (which we will look at next); or it can be on its own. On the left I have it on its own and in the article element the "previous" and "next" links are in nav tags. It's time to get a real HTML editor. There are a number of them.

Why there is a <nav> tag in HTML 5?, The <nav> tag is used to declaring the navigational section in HTML documents. Websites typically have sections dedicated to navigational links, which enables  The HTML <nav> element represents a section of a page whose purpose is to provide navigation links, either within the current document or to other documents. Common examples of navigation sections are menus, tables of contents, and indexes. HTML Demo: <nav>.

HTML, The <nav> element is typically a replacement for the <div class="nav"> statement, frequently used in HTML. Tag-Specific Attributes. The <nav> tag doesn't have  In those cases where the navigation is too minor to justify the use of the <nav> element, <section> is most likely the element that you should use instead. A <nav> doesn’t have to be a list of links. The most common use case for a <nav> is to wrap it around a list of links but it doesn’t have to be a list of links.

HTML5 nav Tag, The nav element represents a section of a page that links to other pages or while a nav element can be used in such cases, it is usually unnecessary. A nav element doesn't have to contain a list, it can contain other kinds  The HTML 5 [code html]<nav>[/code] tag should be used to declare navigational links over your website. In other words it has been made to create menu sections and to

Comments
  • <ul>s should not have <div> children (and what's your CSS?)
  • <center> doesn't exist anymore
  • ul#menu has no closing tag
  • button is not a valid child of a, see: developer.mozilla.org/en-US/docs/Web/HTML/Element/a particularly Permitted Content
  • A good answer should briefly explain how it works instead of relying solely on code.