13

What is the universal HTML anchor tag to go to the 'bottom' of the page? I know the tag '#' automatically brings the user to the top of the page but I am not so sure about the bottom of the page though.

bjb568
  • 11,089
  • 11
  • 50
  • 71
OJuice
  • 435
  • 2
  • 6
  • 11

4 Answers4

14

There isn't one.

You can simulate it, though, with something like <a id="bottom"></a>, then linking to #bottom.

You might find this post helpful, as well.

Community
  • 1
  • 1
elixenide
  • 44,308
  • 16
  • 74
  • 100
12

In my opinion, it's better to implement this in JavaScript and definitely jump to the bottom of the page, instead of relying that the CSS styling on a link makes it always appear at the bottom of the page.

This JavaScript snippet will scroll to the bottom of the document:

document.body.scrollIntoView(false);

Inline JavaScript solution

<a href="javascript: document.body.scrollIntoView(false);">Scroll to bottom</a>

Separate JavaScript solution

HTML

<a href="#" id="scroll-to-bottom">Scroll to bottom</a>

JavaScript

document.getElementById("scroll-to-bottom").addEventListener("click", function () {
  document.body.scrollIntoView(false);
});
Nick McCurdy
  • 17,658
  • 5
  • 50
  • 82
3

bung <a name="end"></a> at the end and then <a href="#end"> for the link

Ed Heal
  • 59,252
  • 17
  • 87
  • 127
1

tag #footer

and then

id the footer like so...

<a href="#footer">Go to bottom</a>

<footer id="footer"></footer>

in contrast you can tag to top of page without anchor using the # symbol only. You can use #top as well

Like so...

<a href="#">Go to top</a>