0

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?

waka
  • 3,362
  • 9
  • 35
  • 54

2 Answers2

1

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

danielo
  • 770
  • 2
  • 13
  • 32
0

To do this using a button element, you would need to involve some Javascript.

The home button code should look something like this:

<button class="dropbtn" onclick="location.href='home.html';">Home</button>

Alternatively, you can just use a hyperlink tag a along with CSS:

<a class="dropbtn" href="home.html">Home</a>

This is easier to work with when it comes to styling and being able to just out of the box HTML functionality.

bgallz
  • 111
  • 6