Anchor links are links that take you to a separate section of the same web page. They can be useful to help your readers find what they need quickly in the “table of contents” at the top of a page or the beginning of an article. In addition to the user experience improvement, anchor links are also believed by some SEO professionals to have an indirect positive impact on search rankings. In this article, we’ll quickly review how to use anchor links so that you can implement this on your blog, whether you’re writing for your own photography blog or contributing to a website such as SLR Lounge.
Anchor Link Example
The easiest way to explain an anchor link is to show you exactly what it does. In many articles on our website, you’ll notice that directly after the first paragraph, we create a bullet point list of topics that we will cover in the article and link each of those bullet points to the section of the page containing the information. Let’s do that now for this article. In this article, we’ll review the following:
Notice how each of the links above take you to the section of this page that contains the corresponding information.
How to create a link to an anchor on same page
To link to a section of the same page, first, create the link you want to link from with the following code:
<a href=”#example”>Example Text</a>
Next, markup the section of the page where you want that link to take the user. In our case, we use the headers, so we would use the following:
<h2 id=”example”>Example Header</h2>
Alternatively, you can use the following code:
<h2><a id=”example”></a>Example Header</h2>
When the user clicks the “example text” link, they will be taken to the “Example Header.”
How to create a link to an anchor on another page
Sometimes you may want to link to a specific section of another page on your own website or another website. To do this, you simply do the following:
<a href=”https://www.examplewebsite.com/example-web-page#example”>Example Text</a>
The code will create this link to the section labeled with the id #example on the page https://www.examplewebsite.com/example-web-page
Just make sure the page that https://www.examplewebsite.com/example-web-page has a section with the id #example. Otherwise the link will simply take the user to the top of the page https://www.examplewebsite.com/example-web-page.
Although SLR Lounge is a photography website, we include tips and tricks that related to better blogging and better website experiences to help you grow your businesses. You may also be interested in the following related article: Why Photography Blogging Is Overrated and Better Alternatives for Photographers.