Search code examples
htmlwebhyperlinkhref

How to link menu item with a page?


This is a part from my HTML5 code:

<nav>
    <div class="dropdown">
        <button class="dropbtn">Home</button>
        <div class="dropdown-content">
        </div>
    </div>
    <div class="dropdown">
        <button class="dropbtn">Basic information</button>
        <div class="dropdown-content">
        </div>
    </div>
    <div class="dropdown">
        <button class="dropbtn">Technical parameters</button>
        <div class="dropdown-content">
        </div>
</nav>

Now I realized, that when I open my browser and I click in the menu for example on the home button nothing happens. How can I link the home button with my home.html document?


Solution

  • One alternative is to surround the buttons with a form-tag, like this:<form action="/something.html">. The other alternative is to use a link-tag <a href="" class=""></a>, which U style as a button, and use the same classes for. You can read more here as well Link with button