Linking to specific spots within a page can be useful on long pages with multiple sections. To create a link that jumps people who click it to a specific part of the page, you need 2 things:
- An anchor
- A link
Anchor
The anchor goes in the place on the page you want to jump to. To add an anchor edit the source code and add a unique id attribute to any tag.
Example:
<h2 id="jump-here">
Content Heading</a>
If there is no element in the source code to add the id attribute to, you can add an <a> tag without a source attribute, like so:
<a id="jump-here"></a>
Link
The link will be formatted with a pound sign in front of the anchor text.
If the link and the anchor are on the same page, your link path needs to simply contains the anchor, like so:
<a href="#jump-here">
Link further down the page</a>
If you’re linking from another page on your site, your link path will be a normal relative path followed by the anchor, like so:
<a href="/about"#jump-here">
Link to specific section on another page</a>
If you’re linking to an anchor in a completely different website, your link path will be the normal absolute path followed by the anchor, like so:
<a href="http://example.com/about#jump-here">
Link to specific section on another website.</a>
Instructions
See how to and tips on our Drupal Instruction site. For our WordPress sites, edit the source code as described above.