Anchor links are those links that lets you jump to a certain part of the page. A back-to-top button is actually an example of an anchor link. The Directory Page of this blog uses Anchor links, too.
They would be pretty useful when you make an extremely long post, like a novel for example, and decided to cut it into parts within the post. You can put a Chapter list in the beginning of the post and then all your readers would have to do is click on it to get to that part. Or maybe for a FAQ page. You can put all the questions on the top then the answer somewhere down there. You can just anchor the links to the answers and your readers won’t have to be bothered by scrolling endlessly.
Anyway, that’s just a some of the many things you can do with Anchor links. So as not to make this intro any longer, here’s how you can make anchor links for your blog or your posts.
By the way, this would involve Editting your post’s HTML Source. It’s that HTML button on the top right part of your text editor:
Another window should appear after you click on that. You’ll have to Directly type or copy/paste the codes here in there. Got that?
Ok so first of all, you’ll need the Link. To make a link, you can use this simple HTML code:
<a href="URL_usually_goes_here">Link to somewhere</a>
Note that the underlined part is where URLs on normal links usually goes. And the Link to Somewhere part is what’s going to be rendered on your page.
Now since we’re going to make an anchor link, you won’t be putting a URL into the href attribute. Instead, we’re going to put this:
So after putting that into the link, it should look like this:
<a href="#somewhere">Link to somewhere</a>
See where it went? Make sure you don’t miss a quotation mark by the way. That’s it for the link.
Now we’ll proceed to the part where the link goes. To make the anchor(the part where the link goes to), you’ll need this:
<a name="somewhere" id="somewhere">This is where it goes</a>
The name attribute is the href value of the Anchor link minus the hash sign. So if for example, you put “#there“in the Anchor link, you’ll have to put “there” as the name and id of the Anchor.
You can also anchor a link to a certain part of a different page. For example, you put a link in your page that goes to your FAQ page, you can set that to immediately go to a certain part.
To make it clearer,
<a href="http://example.tumblr.com/faq#somewhere">Link to somewhere</a>
will simply take you to the part of http://example.tumblr.com/faq which has “somewhere” as a name and id.
That’s it! You make as much Anchor links as you want. Just be sure to give them a different href value, name and id for each link and anchor.
Hope I explained it as easily as you would understand. The ask page is always open if ever you get stuck.