There are two steps to creating an anchor that links to a different page.
1) You will want to place an ID attribute on the element you are linking TO. For example, if you are linking to an h1 element, which may look like <h1>My Page</h1>
, it should be adjusted as such, `<h1 id=”mylink”>My Page</h1>’.
2) You will want to create the link on the page you are linking FROM. For example, you may have some text Click Here
which links to the new page. You will want to wrap it in an a
element, with the following structure <a href="my_new_page/#mylink">Click Here</a>
.
The my_new_page
should contain the full url to the page you are linking TO. Followed by the hash tag, and the ID of the element you are linking TO.