Linking to specific spots within a page can be useful on long pages with multiple sections. Doing so is a two-part process.
First you must create an anchor in the document at the point you want to link to.
- Position your cursor at the desired point in the document.
- Click on the Anchor button.
- In the pop-up type a name for your Anchor. It must be alpha numeric and can use dashes but no spaces and should not begin with a number.
Second you create a link that points to this anchor in the same page. (Below are instructions if you want to jump to an anchor in a different page.)
- Create a link as you normally would using the Link button.
- Choose Link to anchor in the text from the Link Type dropdown.
- Then select your anchor from the By Element Id dropdown and click OK.
You will now see an anchor icon where your cursor was. Don’t worry, this anchor icon is only visible in the editor interface.
Jump to an Anchor in a Different page
- Follow the steps in the first part above and save the page.
- Open the page that you want to add the link to and create a link as you normally would using the Link button and “Internal path” option in the “Link Type” field.
- You will have to then edit the source code. Find the link you just created. It will look something like:
<a href=”/link_text”>The clickable text</a>
and add a slash, pound sign and the anchor name to the end of the URL address. So that it looks like:
<a href=”/link_text/#mars”>The clickable text</a>
Back to Top
If you’ve used the anchors to create a table of contents at the top of the page you may wish to add a Back to Top link below each section so your visitors can easily jump back to find the next area that will interest them.
Improve Mobile Experience
Since content gets so narrow on mobile it may be useful to combine a jump link and the hide on desktop class.