/post

Anchor Links

Posted by adrengski on Wednesday, June 13th, 2012
Tagged as: tips easy tutorials


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:

#somewhere

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.
———————————————————-
Additional note:

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.


5 notes | Comments

Comment

blog comments powered by Disqus

Notes

  1. chaimaetalbi reblogged this from html-and-etc
  2. html-and-etc reblogged this from tutobx and added:
    posts. Read More
  3. tutobx posted this
/ask

Questions! Questions!


Before asking a question, make sure to check the FAQs page or the Answers page first incase it's already answered there. If it isn't then ask away!

All questions/TAs, anon or not, will be published on the Answers page so check it if it's already there. The post will be tagged under your URL , too, so tracking your URLs would be a nice way to notify you.

Also note that I may not be able to answer questions ASAP since unfortunately, I also have this evil stuff called "Real life" and it requires me to do things like "Working" and "Socializing". Rest assured though, that I will be answering all questions whenever I go online and if there's any.

DONATE! On a related note, You could also increase the chance of getting answered immediately by Donating! You see, if you donate, that would mean more moolah. If there's moolah around, I don't have to work that much. And if I don't have to work that much, that would mean more time in answering your queries! I mean, that's the only thing that's keeping me away from here anyway. So yeah, a buck wouldn't hurt, right?


Scroll to top