How I link to part of a page on google sites?

4.2k views Asked by At

I am making a website and I am required to use Google Sites. I am trying to make a table of contents, much like Wikipedia has, where links go to a specific part of the page rather then another web page. I've already tried using the method provided in "How do I link to part of a page? (hash?)" by putting the following code in a HTML box:

<p><a href="#jump">This is a link</a></p>
<br><br><br><br><br><br><br>
<p id="jump">hi</p>

When the link is clicked it tries to go to another page.

I have been testing this in Firefox and Chrome, although if a solution only works in one browser it would still be appreciated.

1

There are 1 answers

0
Benji Altman On BEST ANSWER

Doing this does not work inside a HTML box.

You have to use Google's HTML editing of the main code.

The id attribute does not work here so instead you have to use an anchor tag and a name attribute, which can be used just like the id was used before.

Here is some sample code:

<p><a href="#jump">This is a link</a></p>
<!-- stuff here -->
<p><a name="jump">hi</a></p>