Ads 468x60px

Pages

Wednesday, October 18, 2006

How to enable your visitor to jump from one part of your post to another

Sometimes bloggers may want to make it easier to navigate to a particular section of their page by clicking on a link rather than scrolling around the page to look for it. For this, you will have to use the target attribute and the name attribute.

For example, you want your visitor when they click the link evolution to be led to a section "Evolution". Then what you should do is to first put a target attribute at the section "Evolution" somewhere on that same page.

Then in the section Evolution, the target attribute you should put there will look like this:

<h2><a name="evolution">Evolution</a></h2>
or you can also write it this way:
<a name="evolution">lt;/a><h2>Evolution</h2>
or even
<a name="evolution">lt;/a>Evolution or any text, it doesn't matter.

Then, in the original spot from where you want your visitor to jump to the "Evolution" section, you put the name attribute which will look like this:

<a href="#C4">See Evolution</a>

Example



Let's say this have a block of information here, and then described something that would help the reader to jump to the section on evolution. (not sure how much text I need to put in to make a good example). So I put a link here See Evolution

The code for the above link is
<a href="#"evolution">See Evolution</a>

Then I may have a block of text here, which I wish is much longer, but for the moment I am just going to do a simple example to try to demonstrate better. OK, this is the part I want the reader to jump to when I click on the link above:

Evolution

Study of Evolution


The code I put in front of "Study of Evolution" is
<h2><a name="evolution">Evolution</a></h2>

I really wish I have more text to demonstrate better, but there are just too many files in my "to do" folder. However, I think what I did above is enough to illustrate and explain further how to do it. If any reader find any difficulties, do comment in the comments section, and if I have the time, I will do something about it.


NEWER POST    OLDER POST

0 comments:

Post a Comment