Add Anchor Tag Links (Jump To Specific Location On A Page Or Post) Print

  • html
  • 0

By including an anchor tag within a post or page, you can place links in the body of your post which when clicked allow the reader to jump to another location on the same page.

The anchor tag code consists of two HTML elements. 

1) First, you'll want to create the link. If you are linking to a spot on the same page, the format of the link will be similar to:

<a href="#anchor">Link Text</a>

2) The second part of an anchor tag is the actual anchor. The anchor should be placed at the beginning of the line where you want to start reading after you jump similar to:

<a name="anchor"></a>

Variations/options:

The above anchor link only works when you are jumping to a specified spot on the same webpage. If you want a link to jump a specific location on a different page, you'll need to add the #anchor reference to the end of the full URL for the page, similar to:

<a href="http://example.com/blog/2020/05/filename.html#anchor">Link Text</a>

If you want to have the link use an image, switch out the text in the link with the code for an embedded image, like this:

<a href="#anchor"><img src="https://example.com/image.gif" /></a>


Was this answer helpful?

« Back