0

I have a 1 page website, how can I link my button if I click it that it goes down to my footer id of my footer is Footersite

My code:

<div class="openbutton">
    <a href="Footersite">
       <p style="color: white; font-size: 17px;">Contact us</p>
    </a>
</div>

But it doesnt go down. How can i fix this?

zappee
  • 16,326
  • 13
  • 62
  • 109
aria
  • 11
  • 1
  • 4

2 Answers2

2

Even Though you can achieve this with an anchor tag that is not the only way. With button element you can achieve this

HTML Button

div {
  margin-top: 800px;
  width: 100px;
  height: 100px;
  background: tomato;
}
<button onclick="window.location.href='#abc'">Button</button>
<div id="abc"></div>

DEMO

If you want an anchor element then

Anchor tag

div {
  margin-top: 800px;
  width: 100px;
  height: 100px;
  background: tomato;
}
<a href="#abc">Link</a>
<div id="abc"></div>
It worked yesterday.
  • 4,275
  • 10
  • 43
  • 78
1

Simply use anchor link to achieve this:

<div class="openbutton">

  <a href="#Footersite">
    <p style="color: white;font-size: 17px;">
      Contact us
    </p>
  </a>

</div>

<a name="Footersite"></a>
<div style="margin:1000px 0;">
  Footersite
</div>
Chaska
  • 3,145
  • 1
  • 10
  • 17