hash in anchor tags

You need to add an ID to the element that it should 'jump' to.

For example, if you have

<div id="part1">
  <p>Blah blah blah</p>
</div>

<div id="part2">
  <p>Blah blah blah</p>
</div>

<div id="part3">
  <p>Blah blah blah</p>
</div>

And they are all in page.html

Then you can link to page.html#part1, page.html#part2 etc etc and it will jump to the correct part of the page

Update:

You can also use the name attribute however I prefer to use id. This is because anything can have a id but not necessarily a name. For example I don't think name is a valid attribute for an 'a' tag in HTML 5. Also if you have one element with id="part1" and another different element with name="part1", the one with the id will take precendence. To avoid confusion, I just stick with the one method throughout. There's a bit more of a discussion on this here


You need to put named anchors on page2.html, like so:

<a id="1"></a>
…
<a id="2"></a>
…
<a id="3"></a>

Tags:

Html

Anchor